Skip to content

Commit

Permalink
merged assetBridge contract addresses with supported-chains-and-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
vatsalgupta13 committed Jun 5, 2024
1 parent 355f018 commit 97c3c53
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 50 deletions.
2 changes: 1 addition & 1 deletion docs/develop/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ the best cross-chain framework for your dApp.
<Card
title="Building a Cross-chain Token using Router"
description="Learn how to deploy a cross-chain token using Router"
to="/develop/asset-transfer-via-nitro/managing-cross-chain-tokens/building-a-cross-chain-token-using-router"
to="/develop/asset-transfer-via-nitro/building-cross-chain-tokens/building-a-cross-chain-token-using-router"
icon={<Guide />}
/>
</Section>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Building Cross-chain Tokens",
"position": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract ERC20Token is ERC20, ERC20Burnable, AccessControl, ERC20Permit {

Once you have deployed the token on Chain A and you want to integrate this token with other chains where you have liquidity, follow these steps:

1. Grant the Minter role to the Router AssetBridge contract on the chain where the original token in deployed. You can find the AssetBridge contract addresses [here](../assetbridge-contract-addresses).
1. Grant the Minter role to the Router AssetBridge contract on the chain where the original token in deployed. You can find the AssetBridge contract addresses [here](../supported-chains-tokens).
2. Mint the required supply of the deployed token.
3. For each chain on which you want to integrate the token, create wrapped tokens or mirror tokens.
4. Whitelist the token on the source chain AssetBridge contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ xERC20 tokens are a variant of ERC20 tokens that come with modified minting capa

Deploy an xERC20 contract on one chain (any chain based on your preference) and then follow these steps:

1. Grant the Minter role to the Router AssetBridge contract on the chain where the original token in deployed. You can find the AssetBridge contract addresses [here](../assetbridge-contract-addresses).
1. Grant the Minter role to the Router AssetBridge contract on the chain where the original token in deployed. You can find the AssetBridge contract addresses [here](../supported-chains-tokens).
2. Mint the required supply of the deployed token.
3. For each chain on which you want to integrate the token, create wrapped tokens or mirror tokens.
4. Whitelist the token on the source chain AssetBridge contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To integrate a new token that is already present on some blockchains, the follow

### 1. Granting Minter Role

On the original token contract, grant Minter Role to the AssetBridge contract on the chains where the original token is present. You can find the AssetBridge contract addresses [here](../assetbridge-contract-addresses).
On the original token contract, grant Minter Role to the AssetBridge contract on the chains where the original token is present. You can find the AssetBridge contract addresses [here](../supported-chains-tokens).

### 2. Creating Wrapped Token Versions

Expand Down

This file was deleted.

19 changes: 7 additions & 12 deletions docs/develop/asset-transfer-via-nitro/supported-chains-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@ title: Supported Chains and Tokens
sidebar_position: 7
---

import APIData from '../../../src/utils/GatewayAddressTable' ;
import ContractData from '../../../src/utils/ContractAddressTable' ;

## Mainnet
For supported chains on mainnet, please refer below -
<APIData
apiData={[
{ contractConfigUrl: 'https://sentry.lcd.routerprotocol.com/router-protocol/router-chain/multichain/contract_config',
chainConfigUrl: 'https://sentry.lcd.routerprotocol.com/router-protocol/router-chain/multichain/chain_config',
networkType: 'Mainnet', contractType: 'VOYAGER' }
]}
/>

:::info
All valid token addresses can be passed in the API.
:::

<ContractData />





## Testnet

Expand Down
55 changes: 55 additions & 0 deletions src/utils/ContractAddressTable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React, { useEffect, useState } from 'react';
import axios from 'axios';

const ContractData = () => {
const [data, setData] = useState([]);

useEffect(() => {
fetchData();
}, []);

const fetchData = async () => {
try {
const result = await axios.get("https://api-beta.pathfinder.routerprotocol.com/api/contracts");
console.log(result)
const resultArray = Object.keys(result.data).map(chainId => {
return { chainId, ...result.data[chainId] };
});
console.log()
setData(resultArray);
} catch (error) {
console.log(error);
}
};

return (
<div>
<table>
<thead>
<tr>
<th style={{ fontWeight: 'bold' }}>Chain ID</th>
{/* <th style={{ fontWeight: 'bold' }}>Chain Name</th> */}
<th style={{ fontWeight: 'bold' }}>Gateway Contract Address</th>
<th style={{ fontWeight: 'bold' }}>AssetBridge Contract Address</th>
<th style={{ fontWeight: 'bold' }}>DexSpan Contract Address</th>
{/* <th style={{ fontWeight: 'bold' }}>Fee Payer Address</th> */}
</tr>
</thead>
<tbody>
{data.map((item) => (
<tr key={item.chainId}>
<td>{item.chainId}</td>
{/* <td>{item.chainName}</td> */}
<td>{item.forwarderBridge ? item.forwarderBridge : "Not present"}</td>
<td>{item.mintBurnBridge ? item.mintBurnBridge : "Not present"}</td>
<td>{item.dexSpan ? item.dexSpan : "Not present" }</td>
{/* <td>Your Address</td> */}
</tr>
))}
</tbody>
</table>
</div>
);
};

export default ContractData;

0 comments on commit 97c3c53

Please sign in to comment.