Skip to content

Commit

Permalink
Add fantom / arbitrum token type (trustwallet#13296)
Browse files Browse the repository at this point in the history
* add fantom / arbitrum token type
* add arbitrum info
* fix check script
  • Loading branch information
hewigovens authored Sep 2, 2021
1 parent a2b81ab commit c9fda92
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 5 deletions.
1 change: 1 addition & 0 deletions blockchains/arbitrum/allowlist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions blockchains/arbitrum/denylist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
17 changes: 17 additions & 0 deletions blockchains/arbitrum/info/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Arbitrum",
"website": "https://offchainlabs.com",
"description": "Arbitrum is a Layer 2 cryptocurrency platform that makes smart contracts scalable, fast, and private",
"explorer": "https://arbiscan.io",
"research": "https://coinmarketcap.com/alexandria/article/what-is-arbitrum",
"symbol": "ARETH",
"type": "coin",
"decimals": 18,
"status": "active",
"links": [
{
"name": "twitter",
"url": "https://twitter.com/arbitrum"
}
]
}
Binary file added blockchains/arbitrum/info/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions script/generic/asset-infos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ export function chainFromAssetType(type: string): string {
case "POA": return "poa";
case "POLYGON": return "polygon";
case "OPTIMISM": return "optimism";
case "AVALANCHE": return 'avalanchec';
case "AVALANCHE": return "avalanchec";
case "ARBITRUM": return "arbitrum";
case "FANTOM": return "fantom";
default: return "";
}
}
Expand Down Expand Up @@ -294,16 +296,20 @@ export function explorerUrl(chain: string, contract: string): string {
return `https://blockscout.com/xdai/mainnet/tokens/${contract}`;

case CoinType.name(CoinType.poa).toLowerCase():
case 'poa':
case "poa":
return `https://blockscout.com/poa/core/tokens/${contract}`;

case CoinType.name(CoinType.polygon).toLowerCase():
case 'polygon':
case "polygon":
return `https://polygonscan.com/token/${contract}`;
case 'optimism':
case "optimism":
return `https://optimistic.etherscan.io/address/${contract}`;
case 'avalanchec':
case "avalanchec":
return `https://cchain.explorer.avax.network/address/${contract}`
case "arbitrum":
return `https://arbiscan.io/token/${contract}`
case "fantom":
return `https://ftmscan.com/token/${contract}`
}
}
return "";
Expand Down
4 changes: 4 additions & 0 deletions script/generic/blockchains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const Polygon = getChainName(CoinType.polygon);
export const Optimism = "optimism";
export const xDAI = "xdai";
export const Avalanche = "avalanchec";
export const Arbitrum = "arbitrum";
export const Fantom = "fantom";

export const ethForkChains = [
Ethereum,
Expand All @@ -43,6 +45,8 @@ export const ethForkChains = [
Optimism,
xDAI,
Avalanche,
Arbitrum,
Fantom,
];
export const stakingChains = [
Tezos,
Expand Down
4 changes: 4 additions & 0 deletions script/generic/eth-forks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export class EthForks implements ActionInterface {
check: async () => {
const errors: string[] = [];
const assetsFolder = getChainAssetsPath(chain);
if (!isPathExistsSync(assetsFolder)) {
console.log(` Found 0 assets for chain ${chain}`);
return [errors, []];
}
const assetsList = getChainAssetsList(chain);
console.log(` Found ${assetsList.length} assets for chain ${chain}`);
await bluebird.each(assetsList, async (address) => {
Expand Down

0 comments on commit c9fda92

Please sign in to comment.