Skip to content

Commit

Permalink
Feat/arbitrum (#1341)
Browse files Browse the repository at this point in the history
* Added arbitrum secret keys

* Added arbitrum seed tokens

* Fixed test issue

* Added acceptFunOnArbitrumFilter

* Removed .only attribute from a test had remained by mistake

* Added token verification tests

* Updated validators to support arbitrum

* Fixed coingecko id of TrueUsd

* Changed a test description
  • Loading branch information
aminlatifi authored Feb 20, 2024
1 parent 56f9f85 commit ea652a5
Show file tree
Hide file tree
Showing 26 changed files with 2,720 additions and 1,849 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/develop-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
OPTIMISTIC_SCAN_API_KEY: ${{ secrets.OPTIMISTIC_SCAN_API_KEY }}
CELO_SCAN_API_KEY: ${{ secrets.CELO_SCAN_API_KEY }}
CELO_ALFAJORES_SCAN_API_KEY: ${{ secrets.CELO_ALFAJORES_SCAN_API_KEY }}
ARBITRUM_SCAN_API_KEY: ${{ secrets.ARBITRUM_SCAN_API_KEY }}
ARBITRUM_SEPOLIA_SCAN_API_KEY: ${{ secrets.ARBITRUM_SEPOLIA_SCAN_API_KEY }}
MORDOR_ETC_TESTNET: ${{ secrets.MORDOR_ETC_TESTNET }}
ETC_NODE_HTTP_URL: ${{ secrets.ETC_NODE_HTTP_URL }}
SOLANA_TEST_NODE_RPC_URL: ${{ secrets.SOLANA_TEST_NODE_RPC_URL }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/master-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
OPTIMISTIC_SCAN_API_KEY: ${{ secrets.OPTIMISTIC_SCAN_API_KEY }}
CELO_SCAN_API_KEY: ${{ secrets.CELO_SCAN_API_KEY }}
CELO_ALFAJORES_SCAN_API_KEY: ${{ secrets.CELO_ALFAJORES_SCAN_API_KEY }}
ARBITRUM_SCAN_API_KEY: ${{ secrets.ARBITRUM_SCAN_API_KEY }}
ARBITRUM_SEPOLIA_SCAN_API_KEY: ${{ secrets.ARBITRUM_SEPOLIA_SCAN_API_KEY }}
MORDOR_ETC_TESTNET: ${{ secrets.MORDOR_ETC_TESTNET }}
ETC_NODE_HTTP_URL: ${{ secrets.ETC_NODE_HTTP_URL }}
DROP_DATABASE: ${{ secrets.DROP_DATABASE_DURING_TEST_PROD }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/run-tests-on-pr.yml.bck
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@ jobs:
OPTIMISTIC_SCAN_API_KEY: ${{ secrets.OPTIMISTIC_SCAN_API_KEY }}
CELO_SCAN_API_KEY: ${{ secrets.CELO_SCAN_API_KEY }}
CELO_ALFAJORES_SCAN_API_KEY: ${{ secrets.CELO_ALFAJORES_SCAN_API_KEY }}
ARBITRUM_SCAN_API_KEY: ${{ secrets.ARBITRUM_SCAN_API_KEY }}
ARBITRUM_SEPOLIA_SCAN_API_KEY: ${{ secrets.ARBITRUM_SEPOLIA_SCAN_API_KEY }}
MPETH_GRAPHQL_PRICES_URL: ${{ secrets.MPETH_GRAPHQL_PRICES_URL }}
2 changes: 2 additions & 0 deletions .github/workflows/staging-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
OPTIMISTIC_SCAN_API_KEY: ${{ secrets.OPTIMISTIC_SCAN_API_KEY }}
CELO_SCAN_API_KEY: ${{ secrets.CELO_SCAN_API_KEY }}
CELO_ALFAJORES_SCAN_API_KEY: ${{ secrets.CELO_ALFAJORES_SCAN_API_KEY }}
ARBITRUM_SCAN_API_KEY: ${{ secrets.ARBITRUM_SCAN_API_KEY }}
ARBITRUM_SEPOLIA_SCAN_API_KEY: ${{ secrets.ARBITRUM_SEPOLIA_SCAN_API_KEY }}
MORDOR_ETC_TESTNET: ${{ secrets.MORDOR_ETC_TESTNET }}
ETC_NODE_HTTP_URL: ${{ secrets.ETC_NODE_HTTP_URL }}
DROP_DATABASE: ${{ secrets.DROP_DATABASE_DURING_TEST_STAGING }}
Expand Down
9 changes: 9 additions & 0 deletions config/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ CELO_SCAN_API_URL=https://api.celoscan.io/api
CELO_SCAN_API_KEY=0000000000000000000000000000000000
CELO_ALFAJORES_SCAN_API_URL=https://api-alfajores.celoscan.io/api
CELO_ALFAJORES_SCAN_API_KEY=0000000000000000000000000000000000
ARBITRUM_SCAN_API_URL=https://api.arbiscan.io/api
ARBITRUM_SCAN_API_KEY=0000000000000000000000000000000000
ARBITRUM_SEPOLIA_SCAN_API_URL=https://api-sepolia.arbiscan.io/api
ARBITRUM_SEPOLIA_SCAN_API_KEY=0000000000000000000000000000000000
GNOSISSCAN_API_URL=https://api.gnosisscan.io/api
ETHERSCAN_API_KEY=0000000000000000000000000000000000
GNOSISSCAN_API_KEY=0000000000000000000000000000000000
Expand Down Expand Up @@ -223,6 +227,11 @@ MORDOR_ETC_TESTNET_SCAN_API_URL=https://etc-mordor.blockscout.com/api/v1
# https://chainlist.org/chain/63
MORDOR_ETC_TESTNET_NODE_HTTP_URL=https://rpc.mordor.etccooperative.org

# ARBITRUM MAINNET
ARBITRUM_MAINNET_NODE_HTTP_URL=https://arb1.arbitrum.io/rpc

# ARBITRUM SEPOLIA
ARBITRUM_SEPOLIA_NODE_HTTP_URL=https://sepolia-rollup.arbitrum.io/rpc

# This is the address behind donation.eth
MATCHING_FUND_DONATIONS_FROM_ADDRESS=0x6e8873085530406995170Da467010565968C7C62
Expand Down
4 changes: 4 additions & 0 deletions config/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ POLYGON_SCAN_API_URL=https://api.polygonscan.com/api
OPTIMISTIC_SCAN_API_URL=https://api-optimistic.etherscan.io/api
CELO_SCAN_API_URL=https://api.celoscan.io/api
CELO_ALFAJORES_SCAN_API_URL=https://api-alfajores.celoscan.io/api
ARBITRUM_SCAN_API_URL=https://api.arbiscan.io/api
ARBITRUM_SCAN_API_KEY=0000000000000000000000000000000000
ARBITRUM_SEPOLIA_SCAN_API_URL=https://api-sepolia.arbiscan.io/api
ARBITRUM_SEPOLIA_SCAN_API_KEY=0000000000000000000000000000000000
GNOSISSCAN_API_URL=https://api.gnosisscan.io/api
ETHERSCAN_API_KEY=00000000000000000000000000000000
GNOSISSCAN_API_KEY=0000000000000000000000000000000000
Expand Down
53 changes: 53 additions & 0 deletions migration/1708279692128-addArbitrumTokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import { Token } from '../src/entities/token';
import seedTokens from './data/seedTokens';
import config from '../src/config';
import { NETWORK_IDS } from '../src/provider';

export class AddArbitrumTokens1708279692128 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const environment = config.get('ENVIRONMENT') as string;

const networkId =
environment === 'production'
? NETWORK_IDS.ARBITRUM_MAINNET
: NETWORK_IDS.ARBITRUM_SEPOLIA;

await queryRunner.manager.save(
Token,
seedTokens
.filter(token => token.networkId === networkId)
.map(token => {
const t = {
...token,
};
t.address = t.address?.toLowerCase();
delete t.chainType;
return t;
}),
);
const tokens = await queryRunner.query(`
SELECT * FROM token
WHERE "networkId" = ${networkId}
`);
const givethOrganization = (
await queryRunner.query(`SELECT * FROM organization
WHERE label='giveth'`)
)[0];

const traceOrganization = (
await queryRunner.query(`SELECT * FROM organization
WHERE label='trace'`)
)[0];

for (const token of tokens) {
// Add all Polygon tokens to Giveth organization
await queryRunner.query(`INSERT INTO organization_tokens_token ("tokenId","organizationId") VALUES
(${token.id}, ${givethOrganization.id}),
(${token.id}, ${traceOrganization.id})
;`);
}
}

public async down(queryRunner: QueryRunner): Promise<void> {}
}
233 changes: 233 additions & 0 deletions migration/data/seedTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface ITokenData {
networkId: number;
chainType?: ChainType;
coingeckoId?: string;
isStableCoin?: boolean;
}
const seedTokens: ITokenData[] = [
// Mainnet tokens
Expand Down Expand Up @@ -1376,6 +1377,238 @@ const seedTokens: ITokenData[] = [
chainType: ChainType.SOLANA,
coingeckoId: COINGECKO_TOKEN_IDS.SOLANA,
},

// ARBITRUM Sepolia
{
name: 'Arbitrum Sepolia native token',
symbol: 'ETH',
address: '0x0000000000000000000000000000000000000000',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_SEPOLIA,
coingeckoId: 'ethereum',
},
{
name: 'Chromatic test Eth',
symbol: 'cETH',
address: '0x93252009E644138b906aE1a28792229E577239B9',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_SEPOLIA,
coingeckoId: 'weth',
},
{
name: 'Arbitrum ETH',
symbol: 'ETH',
address: '0x0000000000000000000000000000000000000000',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'ethereum',
},
{
name: 'usdt',
symbol: 'USDT',
address: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9',
decimals: 6,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'tether',
// isStableCoin: true,
},
{
name: 'USDC',
symbol: 'USDC',
address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
decimals: 6,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'usd-coin',
// isStableCoin: true,
},
{
name: 'Chainlink',
symbol: 'LINK',
address: '0xf97f4df75117a78c1A5a0DBb814Af92458539FB4',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'chainlink',
},
{
name: 'Dai',
symbol: 'DAI',
address: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'dai',
// isStableCoin: true,
},
{
name: 'Uniswap',
symbol: 'UNI',
address: '0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'uniswap',
},
{
name: 'Lido',
symbol: 'LDO',
address: '0x13Ad51ed4F1B7e9Dc168d8a00cB3f4dDD85EfA60',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'lido-dao',
},
{
name: 'Arbitrum',
symbol: 'ARB',
address: '0x912CE59144191C1204E64559FE8253a0e49E6548',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'arbitrum',
},
{
name: 'Brigded ISDC',
symbol: 'USDC',
address: '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8',
decimals: 6,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'usd-coin',
// isStableCoin: true,
},
{
name: 'TrueUSD',
symbol: 'TUSD',
address: '0x4D15a3A2286D883AF0AA1B3f21367843FAc63E07',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'true-usd',
// isStableCoin: true,
},
{
name: 'The Graph',
symbol: 'GRT',
address: '0x9623063377AD1B27544C965cCd7342f7EA7e88C7',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'the-graph',
},
{
name: 'Frax Share',
symbol: 'FXS',
address: '0x9d2f299715d94d8a7e6f5eaa8e654e8c74a988a7',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'frax-share',
},
{
name: 'USDD',
symbol: 'USDD',
address: '0x680447595e8b7b3Aa1B43beB9f6098C79ac2Ab3f',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'usdd',
// isStableCoin: true,
},
{
name: 'WOO',
symbol: 'WOO',
address: '0xcafcd85d8ca7ad1e1c6f82f651fa15e33aefd07b',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'woo-network',
},
{
name: 'Gnosis',
symbol: 'GNO',
address: '0xa0b862f60edef4452f25b4160f177db44deb6cf1',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'gnosis',
},
{
name: 'Curve DAO Token',
symbol: 'CRV',
address: '0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'curve-dao-token',
},
{
name: 'Compound',
symbol: 'COMP',
address: '0x354A6dA3fcde098F8389cad84b0182725c6C91dE',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'compound-governance-token',
},
{
name: 'GMX',
symbol: 'GMX',
address: '0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'gmx',
},
{
name: 'Loopring',
symbol: 'LRC',
address: '0x46d0cE7de6247b0A95f67b43B589b4041BaE7fbE',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'loopring',
},
{
name: 'Treasure',
symbol: 'MAGIC',
address: '0x539bdE0d7Dbd336b79148AA742883198BBF60342',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'treasure',
},
{
name: 'SushiSwap',
symbol: 'SUSHI',
address: '0xd4d42f0b6def4ce0383636770ef773390d85c61a',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'sushi',
},
{
name: 'yearn.finance',
symbol: 'YFI',
address: '0x82e3A8F066a6989666b031d916c43672085b1582',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'yearn-finance',
},
{
name: 'Xai',
symbol: 'XAI',
address: '0x4Cb9a7AE498CEDcBb5EAe9f25736aE7d428C9D66',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'xai',
},
{
name: 'Livepeer',
symbol: 'LPT',
address: '0x289ba1701C2F088cf0faf8B3705246331cB8A839',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'livepeer',
},
{
name: 'Wrapped Bitcoin',
symbol: 'WBTC',
address: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f',
decimals: 8,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'wrapped-bitcoin',
},
{
name: 'Cartesi',
symbol: 'CTSI',
address: '0x319f865b287fCC10b30d8cE6144e8b6D1b476999',
decimals: 18,
networkId: NETWORK_IDS.ARBITRUM_MAINNET,
coingeckoId: 'cartesi',
},
];

export default seedTokens;
1 change: 1 addition & 0 deletions src/entities/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export enum FilterField {
AcceptFundOnPolygon = 'acceptFundOnPolygon',
AcceptFundOnETC = 'acceptFundOnETC',
AcceptFundOnCelo = 'acceptFundOnCelo',
AcceptFundOnArbitrum = 'acceptFundOnArbitrum',
AcceptFundOnOptimism = 'acceptFundOnOptimism',
AcceptFundOnSolana = 'acceptFundOnSolana',
GivingBlock = 'fromGivingBlock',
Expand Down
Loading

0 comments on commit ea652a5

Please sign in to comment.