Adding Rollux to your CEX

... About 3 min

# Connecting to Rollux

Typically you connect to Rollux the same way you do to Syscoin NEVM or Ethereum, by connecting to a JSON RPC endpoint.

The other option is to set up and operate your own Rollux replica node.

Info

The supported release for Rollux is Istanbul, so it supports EIP-1559.

# Endpoints

Click here for the Rollux endpoints. You can choose between our public endpoints, which are rate limited, and endpoints from infrastructure providers. Given rate throughput limits, we recommend using a private rpc provider like Ankr (opens new window) for both mainnet and testnet use cases.

# SYS balance

In Rollux, SYS is used precisely the way that it is used on the L1 Syscoin NEVM (same as how ETH is used in Ethereum).

# Token addresses

The ERC-20 contract address for a token on Rollux may be different from the address for the same token on Syscoin.

To get the total balance of a user that uses Rollux, you need to:

  1. Connect to a standard Syscoin L1 endpoint and submit a balanceOf query with the token contract address on Syscoin.
  2. Connect to a Rollux endpoint and send a balanceOf query with the token contract address on Rollux.

# Deposits and withdrawals within Rollux

The ERC-20 contracts on Rollux function the same way they do on Syscoin NEVM and Ethereum, so you can use your existing code for withdrawals and deposits. Just connect to a Rollux endpoint.

# Transaction fees

Most of the cost of a Rollux transaction is not the gas consumed by the transaction itself, but the cost of writing the transaction to Syscoin. That cost is deducted automatically from the user's balance on Rollux. If you charge your users the cost of withdrawals, you may have to account for it. In any case, the cost is typically very low.

You can read more about this subject here. The relevant code is here (opens new window).

# Deposits and withdrawals across chains

As a centralized exchange, there will be times that withdrawals of SYS or an ERC-20 token on either Rollux or Syscoin NEVM exceed deposits and you need to transfer assets. To do that you use a bridge or a gateway. We have a standard gateway (opens new window) that receives assets on L1 (Syscoin NEVM mainnet), and mints the equivalent asset on Rollux. When a user wants to withdraw the assets back to L1, the bridge burns the asset on L2 and releases it to the user on L1. If you want to use this gateway automatically, follow this tutorial for SYS (opens new window) or this one for ERC-20 tokens (opens new window).

Note that while L1 to L2 transactions typically take minutes, L2 to L1 transaction on the gateway require a seven day challenge period which is an artifact of Rollux being an optimistic rollup. Alternatively, you can use a third party bridge. These bridges usually rely on liquidity pools to allow for faster withdrawals and support multiple L2 chains. However, their token selection might be more limited and they are typically not as decentralized as our gateway.

When an ERC-20 token does not have a Rollux equivalent you can create one. If there is no need for custom business logic, you can follow the steps in this tutorial (opens new window). If you need to implement some kind of custom logic, see this tutorial (opens new window).

# Audit reports

  • For a list of audit reports, visit GitHub (opens new window). In addition to Optimism's multiple audits, Rollux has been audited to give full coverage to the differences between Rollux and Optimism.