# Contracts & Events

All addresses and ABIs on this page are public and safe to hardcode into client builds. Token contract addresses may change as new assets are added — always prefer reading them from [`GET /bridge/limits`](/developer-guide/bridge/api-reference.md#get-bridge-limits) and the token registry in [Smart Contract Addresses](/reference/contracts.md) when possible.

## Mainnet Addresses

### Bridge Contracts

| Contract           | Chain                   | Address                                                                                                                         |
| ------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **BridgeLock**     | Ethereum Mainnet (`1`)  | [`0xa9fd64b5095d626f5a3a67e6db7fb766345f8092`](https://etherscan.io/address/0xa9fd64b5095d626f5a3a67e6db7fb766345f8092)         |
| **BridgeMint**     | Goliath Mainnet (`327`) | [`0x1d14ae13ca030eb5e9e2857e911af515cf5ffff2`](https://explorer.goliath.net/address/0x1d14ae13ca030eb5e9e2857e911af515cf5ffff2) |
| **Relayer wallet** | Both                    | `0x90F26908Ee30C8fA6812f6BA66c050a86C8aF6cB`                                                                                    |

### Ethereum Mainnet Tokens

| Token    | Address                                                                                                                 |
| -------- | ----------------------------------------------------------------------------------------------------------------------- |
| **ETH**  | Native                                                                                                                  |
| **USDC** | [`0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) |
| **XCN**  | [`0xA2cd3D43c775978A96BdBf12d733D5A1ED94fb18`](https://etherscan.io/address/0xA2cd3D43c775978A96BdBf12d733D5A1ED94fb18) |

### Goliath Mainnet Bridged Tokens

| Token              | Address                                                                                                                         | Decimals          |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
| **ETH** (bridged)  | [`0x9253587505c3B7E7b9DEE118AE1AcB53eEC0E4b6`](https://explorer.goliath.net/address/0x9253587505c3B7E7b9DEE118AE1AcB53eEC0E4b6) | 18                |
| **USDC** (bridged) | [`0xC8410270bb53f6c99A2EFe6eD3686a8630Efe22B`](https://explorer.goliath.net/address/0xC8410270bb53f6c99A2EFe6eD3686a8630Efe22B) | 6                 |
| **XCN**            | Native gas token                                                                                                                | 18 (via JSON-RPC) |

## Testnet Addresses

### Bridge Contracts

| Contract                       | Chain                         | Address                                      |
| ------------------------------ | ----------------------------- | -------------------------------------------- |
| **BridgeLock** (BridgeSepolia) | Ethereum Sepolia (`11155111`) | `0xA9FD64B5095d626F5A3A67e6DB7FB766345F8092` |
| **BridgeMint** (BridgeGoliath) | Goliath Testnet (`8901`)      | `0x2c1d218B5a97a26D144ffd12d5C813590f93FFEB` |

### Goliath Testnet Bridged Tokens

| Token                    | Address                                      | Decimals |
| ------------------------ | -------------------------------------------- | -------- |
| **ETH** (bridged)        | `0xEd02AA7dd3f105EDab8702D859781CAfF111324b` | 18       |
| **USDC** (bridged)       | `0x4BE65Dce1D79B8728485B759eE06cC8053E824F4` | 6        |
| **Sepolia XCN** (ERC-20) | `0x7a8adc542A35c93da263A188367F4bF4c445B8E9` | 18       |

***

## BridgeLock ABI (User Functions)

BridgeLock is deployed on Ethereum. External developers call `deposit(...)` or `depositNative(...)` to initiate an Ethereum → Goliath transfer, and observe the `Deposit` event. The `Release` event fires when the relayer delivers a Goliath → Ethereum withdrawal.

```json
[
  {
    "inputs": [
      { "name": "token",              "type": "address" },
      { "name": "amount",             "type": "uint256" },
      { "name": "destinationAddress", "type": "address" }
    ],
    "name": "deposit",
    "outputs": [{ "name": "depositId", "type": "bytes32" }],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      { "name": "destinationAddress", "type": "address" }
    ],
    "name": "depositNative",
    "outputs": [{ "name": "depositId", "type": "bytes32" }],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true,  "name": "depositId",          "type": "bytes32" },
      { "indexed": true,  "name": "token",              "type": "address" },
      { "indexed": true,  "name": "sender",             "type": "address" },
      { "indexed": false, "name": "destinationAddress", "type": "address" },
      { "indexed": false, "name": "amount",             "type": "uint256" },
      { "indexed": false, "name": "timestamp",          "type": "uint64"  },
      { "indexed": false, "name": "sourceChainId",      "type": "uint64"  }
    ],
    "name": "Deposit",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true,  "name": "withdrawId", "type": "bytes32" },
      { "indexed": true,  "name": "token",      "type": "address" },
      { "indexed": true,  "name": "recipient",  "type": "address" },
      { "indexed": false, "name": "amount",     "type": "uint256" }
    ],
    "name": "Release",
    "type": "event"
  }
]
```

### Event Topic Hashes

| Event                                                            | Topic 0                                                                       |
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `Deposit(bytes32,address,address,address,uint256,uint64,uint64)` | `keccak256("Deposit(bytes32,address,address,address,uint256,uint64,uint64)")` |
| `Release(bytes32,address,address,uint256)`                       | `keccak256("Release(bytes32,address,address,uint256)")`                       |

{% hint style="info" %}
For `Deposit.token`, `address(0)` indicates **native ETH**. Any other value is an ERC-20 address.
{% endhint %}

***

## BridgeMint ABI (User Functions)

BridgeMint is deployed on Goliath. External developers call `burn(...)` to initiate a Goliath → Ethereum transfer for **bridged ERC-20s** (ETH, USDC). For native XCN withdrawals use the [intent API](/developer-guide/bridge/api-reference.md#post-bridge-xcn-withdraw-intent) instead. The `Mint` event fires when the relayer delivers an Ethereum → Goliath deposit.

```json
[
  {
    "inputs": [
      { "name": "token",                "type": "address" },
      { "name": "amount",               "type": "uint256" },
      { "name": "destinationAddress",   "type": "address" },
      { "name": "destinationChainId",   "type": "uint64"  }
    ],
    "name": "burn",
    "outputs": [{ "name": "withdrawId", "type": "bytes32" }],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true,  "name": "withdrawId",          "type": "bytes32" },
      { "indexed": true,  "name": "token",               "type": "address" },
      { "indexed": true,  "name": "sender",              "type": "address" },
      { "indexed": false, "name": "destinationAddress",  "type": "address" },
      { "indexed": false, "name": "amount",              "type": "uint256" },
      { "indexed": false, "name": "timestamp",           "type": "uint64"  },
      { "indexed": false, "name": "sourceChainId",       "type": "uint64"  },
      { "indexed": false, "name": "destinationChainId",  "type": "uint64"  }
    ],
    "name": "Withdraw",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true,  "name": "depositId", "type": "bytes32" },
      { "indexed": true,  "name": "token",     "type": "address" },
      { "indexed": true,  "name": "recipient", "type": "address" },
      { "indexed": false, "name": "amount",    "type": "uint256" }
    ],
    "name": "Mint",
    "type": "event"
  }
]
```

### Event Topic Hashes

| Event                                                                    | Topic 0                                                                               |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| `Withdraw(bytes32,address,address,address,uint256,uint64,uint64,uint64)` | `keccak256("Withdraw(bytes32,address,address,address,uint256,uint64,uint64,uint64)")` |
| `Mint(bytes32,address,address,uint256)`                                  | `keccak256("Mint(bytes32,address,address,uint256)")`                                  |

***

## Correlation Between Source and Destination

Use these indexed fields to correlate the two legs of a bridge transfer:

| Direction | Source event          | Destination event    | Shared field         |
| --------- | --------------------- | -------------------- | -------------------- |
| E → G     | `Deposit.depositId`   | `Mint.depositId`     | `bytes32 depositId`  |
| G → E     | `Withdraw.withdrawId` | `Release.withdrawId` | `bytes32 withdrawId` |

The bridge REST API does the same correlation for you — pass either identifier to [`GET /bridge/status`](/developer-guide/bridge/api-reference.md#get-bridge-status) and you'll get a single response covering both sides.

## Verifying Source

Both contracts are verified on their respective block explorers:

* BridgeLock on Etherscan — [0xa9fd64b5...345f8092](https://etherscan.io/address/0xa9fd64b5095d626f5a3a67e6db7fb766345f8092)
* BridgeMint on Goliath Explorer — [0x1d14ae13...f5ffff2](https://explorer.goliath.net/address/0x1d14ae13ca030eb5e9e2857e911af515cf5ffff2)

The source for both is published at [github.com/Onyx-Protocol](https://github.com/Onyx-Protocol) (`wXCN` repository).

## Related Docs

* [Architecture](/developer-guide/bridge/architecture.md) — how events drive the lock-and-mint flow.
* [API Reference](/developer-guide/bridge/api-reference.md) — correlate event data with bridge operations.
* [Smart Contract Addresses](/reference/contracts.md) — full contract registry beyond the bridge.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.goliath.net/developer-guide/bridge/contracts-and-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
