Skip to content

Commit

Permalink
Merge pull request #223 from dwusiq/dev
Browse files Browse the repository at this point in the history
New support chain
  • Loading branch information
yanyanho authored Apr 5, 2024
2 parents a0a79a4 + 6b91e8c commit b1b9def
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 3 deletions.
25 changes: 25 additions & 0 deletions src/main/java/com/dl/officialsite/aave/constants/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,34 @@ public class Constant {
ARB_USDT,ARB_WETH,ARB_WBTC,ARB_USDC_E,ARB_USDC_LUSD);





// public static final TokenConfig BASE_DAI =TokenConfig.builder().name("DAI").address("").build();
public static final TokenConfig BASE_USDC =TokenConfig.builder().name("USDC").address("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913").build();
// public static final TokenConfig BASE_USDT =TokenConfig.builder().name("USDT").address("").build();
public static final TokenConfig BASE_WETH =TokenConfig.builder().name("WETH").address("0x4200000000000000000000000000000000000006").build();
// public static final TokenConfig BASE_WBTC =TokenConfig.builder().name("WBTC").address("").build();
public static final List<TokenConfig> BASE_TOKEN_LIST =Arrays.asList(BASE_USDC,BASE_WETH);




public static final TokenConfig GNOSIS_DAI =TokenConfig.builder().name("DAI").address("0x44fA8E6f47987339850636F88629646662444217").build();
public static final TokenConfig GNOSIS_USDC =TokenConfig.builder().name("USDC").address("0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83").build();
public static final TokenConfig GNOSIS_USDT =TokenConfig.builder().name("USDT").address("0x4ECaBa5870353805a9F068101A40E0f32ed605C6").build();
public static final TokenConfig GNOSIS_WETH =TokenConfig.builder().name("WETH").address("0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1").build();
// public static final TokenConfig GNOSIS_WBTC =TokenConfig.builder().name("WBTC").address("").build();
public static final List<TokenConfig> GNOSIS_TOKEN_LIST =Arrays.asList(GNOSIS_DAI,GNOSIS_USDC,GNOSIS_USDT,GNOSIS_WETH);


public static ConcurrentHashMap<String,List<TokenConfig>> tokenConfigListMap = new ConcurrentHashMap<String, List<TokenConfig>>() {{
put( Constants.CHAIN_ID_POLYGON, POLYGON_TOKEN_LIST);
put( Constants.CHAIN_ID_OP, OP_TOKEN_LIST);
put( Constants.CHAIN_ID_SCROLL, SCROLL_TOKEN_LIST);
put( Constants.CHAIN_ID_ARBITRUM, ARB_TOKEN_LIST);
put( Constants.CHAIN_ID_BASE, BASE_TOKEN_LIST);
put( Constants.CHAIN_ID_GNOSIS, GNOSIS_TOKEN_LIST);
}};


Expand All @@ -84,6 +107,8 @@ public class Constant {
put( Constants.CHAIN_ID_OP, "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb");
put( Constants.CHAIN_ID_SCROLL, "0x69850D0B276776781C063771b161bd8894BCdD04");
put( Constants.CHAIN_ID_ARBITRUM, "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb");
put( Constants.CHAIN_ID_BASE, "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D");
put( Constants.CHAIN_ID_GNOSIS, "0x36616cf17557639614c1cdDb356b1B83fc0B2132");
}};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public class Constants {
public static final String CHAIN_ID_ARBITRUM = "42161";
public static final String CHAIN_ID_ZKSYNC = "324";
public static final String CHAIN_ID_POLYGON = "137";
public static final String CHAIN_ID_POLYGON_ZKEVM = "1101";
public static final String CHAIN_ID_LINEA = "59144";
public static final String CHAIN_ID_BASE = "8453";
public static final String CHAIN_ID_GNOSIS = "100";


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ private HttpEntity getHttpEntityFromChain(String chainId) throws IOException {
case Constants.CHAIN_ID_ZKSYNC: // zksync
request = new HttpPost("https://api.studio.thegraph.com/query/64403/zksync/version/latest");
break;

case Constants.CHAIN_ID_POLYGON_ZKEVM: // polygon zkevm
request = new HttpPost("https://api.studio.thegraph.com/query/64403/polygonzkevm/version/latest");
break;
case Constants.CHAIN_ID_LINEA: //linea
request = new HttpPost("https://api.studio.thegraph.com/query/64403/linea/version/latest");
break;
}

if (request == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ private HttpEntity getHttpEntityFromChain(String chainId) throws IOException {
case Constants.CHAIN_ID_ZKSYNC: //zksync
request = new HttpPost("https://api.studio.thegraph.com/query/64274/zksync/version/latest");
break;
case Constants.CHAIN_ID_POLYGON_ZKEVM: //polygon zkevm
request = new HttpPost("https://api.studio.thegraph.com/query/64274/polygonzkevm/version/latest");
break;
case Constants.CHAIN_ID_LINEA: //linea
request = new HttpPost("⁠https://api.studio.thegraph.com/query/64274/linea/version/latest");
break;

}
request.setHeader("Content-Type", "application/json");
Expand Down
11 changes: 9 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ web3j:
client-address: "https://polygon-rpc.com"
httpTimeoutSeconds: ${WEB3J_HTTP_TIMEOUT_SECOND:300}


network:
configs:
- id: "137"
Expand All @@ -70,6 +69,14 @@ network:
- id: "42161"
name: "arbitrum"
rpc: "https://arbitrum.llamarpc.com"
- id: "8453"
name: "base"
rpc: "https://base.llamarpc.com"
- id: "100"
name: "gnosis"
rpc: "https://gnosis.drpc.org"



jobs:
redpacket:
Expand Down Expand Up @@ -101,7 +108,7 @@ qcloud:
regionName: ${REGION_NAME}

chain:
ids: ["11155111","10", "534352", "42161", "324"]
ids: ["11155111", "10", "534352", "42161", "324", "1101", "59144"]

login:
filter: ${LOGIN_FILTER:true}
Expand Down

0 comments on commit b1b9def

Please sign in to comment.