Skip to content

Commit

Permalink
feat: (2nd Attempt) fix mantle network (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
MantisClone authored Sep 13, 2023
1 parent 2a807f6 commit 4a6b560
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
24 changes: 22 additions & 2 deletions cli/commands/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export const handler = () => {
for (const network of networks) {
console.log(`parsing network ${network}`);
const manifest = getManifest(
network,
network === "gnosis" ? "xdai" : network,
getTheGraphChainName(network),
getRequestNetworkChainName(network),
);
if (!manifest) {
console.warn(`No contract found for ${network}`);
Expand All @@ -22,3 +22,23 @@ export const handler = () => {
}
}
};

const getTheGraphChainName = (chainName: string) => {
switch(chainName) {
case "mantle-testnet":
return "testnet";
case "mantle":
return "mainnet";
default:
return chainName;
}
}

const getRequestNetworkChainName = (chainName: string) => {
switch(chainName) {
case "gnosis":
return "xdai";
default:
return chainName;
}
}
8 changes: 4 additions & 4 deletions subgraph.mantle-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ schema:
dataSources:
- kind: ethereum/contract
name: ERC20Proxy
network: testnet
network: mantle-testnet
source:
address: "0x88Ecc15fDC2985A7926171B938BB2Cd808A5ba40"
abi: ERC20Proxy
Expand All @@ -25,7 +25,7 @@ dataSources:
file: ./src/erc20Proxy.ts
- kind: ethereum/contract
name: ERC20FeeProxy_0_2_0
network: testnet
network: mantle-testnet
source:
address: "0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE"
abi: ERC20FeeProxy_0_2_0
Expand All @@ -46,7 +46,7 @@ dataSources:
file: ./src/erc20FeeProxy.ts
- kind: ethereum/contract
name: EthProxy_0_3_0
network: testnet
network: mantle-testnet
source:
address: "0x171Ee0881407d4c0C11eA1a2FB7D5b4cdED71e6e"
abi: EthProxy_0_3_0
Expand All @@ -67,7 +67,7 @@ dataSources:
file: ./src/ethProxy.ts
- kind: ethereum/contract
name: EthFeeProxy_0_2_0
network: testnet
network: mantle-testnet
source:
address: "0xe11BF2fDA23bF0A98365e1A4c04A87C9339e8687"
abi: EthFeeProxy_0_2_0
Expand Down
8 changes: 4 additions & 4 deletions subgraph.mantle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ schema:
dataSources:
- kind: ethereum/contract
name: ERC20Proxy
network: mainnet
network: mantle
source:
address: "0x88Ecc15fDC2985A7926171B938BB2Cd808A5ba40"
abi: ERC20Proxy
Expand All @@ -25,7 +25,7 @@ dataSources:
file: ./src/erc20Proxy.ts
- kind: ethereum/contract
name: ERC20FeeProxy_0_2_0
network: mainnet
network: mantle
source:
address: "0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE"
abi: ERC20FeeProxy_0_2_0
Expand All @@ -46,7 +46,7 @@ dataSources:
file: ./src/erc20FeeProxy.ts
- kind: ethereum/contract
name: EthProxy_0_3_0
network: mainnet
network: mantle
source:
address: "0x171Ee0881407d4c0C11eA1a2FB7D5b4cdED71e6e"
abi: EthProxy_0_3_0
Expand All @@ -67,7 +67,7 @@ dataSources:
file: ./src/ethProxy.ts
- kind: ethereum/contract
name: EthFeeProxy_0_2_0
network: mainnet
network: mantle
source:
address: "0xe11BF2fDA23bF0A98365e1A4c04A87C9339e8687"
abi: EthFeeProxy_0_2_0
Expand Down

0 comments on commit 4a6b560

Please sign in to comment.