Skip to content

Commit

Permalink
chore: add sepolia config and subgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
levalleux-ludo committed Mar 19, 2024
1 parent 029f2b4 commit bc20121
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-staging-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
run: npx graph auth --product hosted-service ${{ secrets.THE_GRAPH_ACCESS_TOKEN_STAGING }}
- name: Deploy subgraph to mumbai
run: cd ./packages/subgraph && npm run deploy:staging
- name: Deploy subgraph to goerli
run: cd ./packages/subgraph && npm run deploy:staging:goerli
- name: Deploy subgraph to sepolia
run: cd ./packages/subgraph && npm run deploy:staging:sepolia
4 changes: 2 additions & 2 deletions .github/workflows/deploy-testing-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
run: npx graph auth --product hosted-service ${{ secrets.THE_GRAPH_ACCESS_TOKEN_TESTING }}
- name: Deploy subgraph to mumbai
run: cd ./packages/subgraph && npm run deploy:testing
- name: Deploy subgraph to goerli
run: cd ./packages/subgraph && npm run deploy:testing:goerli
- name: Deploy subgraph to sepolia
run: cd ./packages/subgraph && npm run deploy:testing:sepolia
16 changes: 16 additions & 0 deletions .github/workflows/pin-to-pinata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ jobs:
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
echo "Pin for testing/sepolia env..."
npm run pin-to-pinata -- \
-e testing \
-c testing-11155111-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
echo "Pin for staging/mumbai env..."
npm run pin-to-pinata -- \
-e staging \
Expand All @@ -68,6 +76,14 @@ jobs:
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
echo "Pin for staging/sepolia env..."
npm run pin-to-pinata -- \
-e staging \
-c staging-11155111-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
echo "Pin for production/polygon env..."
npm run pin-to-pinata -- \
-e production \
Expand Down
3 changes: 2 additions & 1 deletion packages/common/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export const chains = {
80001: 80001,
137: 137,
1: 1,
5: 5
5: 5,
11155111: 11155111
} as const;
48 changes: 48 additions & 0 deletions packages/common/src/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,30 @@ export const envConfigs: Record<EnvironmentType, ProtocolConfig[]> = {
},
metaTx: undefined,
lens: undefined
},
{
envName: "testing",
chainId: 11155111,
configId: "testing-11155111-0",
sellersBlackList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/main/bosonApp.io/testing-11155111-0/sellers/blacklist.json",
defaultDisputeResolverId: "1", // TODO: to be confirmed
defaultTokens: chainIdToDefaultTokens.get(11155111),
nativeCoin: chainIdToInfo.get(11155111),
getTxExplorerUrl: chainIdToGraphTx.get(11155111),
subgraphUrl:
"https://api.thegraph.com/subgraphs/name/bosonprotocol/sepolia-testing",
jsonRpcUrl:
"https://sepolia.infura.io/v3/b832a48b9bce4aa6bd9da86eb0126300",
theGraphIpfsUrl: "https://api.thegraph.com/ipfs/api/v0",
ipfsMetadataUrl: "https://ipfs.infura.io:5001",
contracts: {
// from https://github.com/bosonprotocol/boson-protocol-contracts/pull/807
protocolDiamond: "0x76051fc05ab42d912a737d59a8711f1446712630",
forwarder: "0xffffffffffffffffffffffffffffffffffffffff" // https://docs-gasless.biconomy.io/misc/contract-addresses
},
metaTx: undefined,
lens: undefined
}
],
staging: [
Expand Down Expand Up @@ -146,6 +170,30 @@ export const envConfigs: Record<EnvironmentType, ProtocolConfig[]> = {
},
metaTx: undefined,
lens: undefined
},
{
envName: "staging",
chainId: 11155111,
configId: "staging-11155111-0",
sellersBlackList:
"https://raw.githubusercontent.com/BAppLimited/curationLists/main/bosonApp.io/staging-11155111-0/sellers/blacklist.json",
defaultDisputeResolverId: "1", // TODO: to be confirmed
defaultTokens: chainIdToDefaultTokens.get(11155111),
nativeCoin: chainIdToInfo.get(11155111),
getTxExplorerUrl: chainIdToGraphTx.get(11155111),
subgraphUrl:
"https://api.thegraph.com/subgraphs/name/bosonprotocol/sepolia-staging",
jsonRpcUrl:
"https://sepolia.infura.io/v3/b832a48b9bce4aa6bd9da86eb0126300",
theGraphIpfsUrl: "https://api.thegraph.com/ipfs/api/v0",
ipfsMetadataUrl: "https://ipfs.infura.io:5001",
contracts: {
// from https://github.com/bosonprotocol/boson-protocol-contracts/pull/807
protocolDiamond: "0xffffffffffffffffffffffffffffffffffffffff", // TODO: change it
forwarder: "0xffffffffffffffffffffffffffffffffffffffff" // https://docs-gasless.biconomy.io/misc/contract-addresses
},
metaTx: undefined,
lens: undefined
}
],
production: [
Expand Down
45 changes: 45 additions & 0 deletions packages/common/src/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const chainIdToInfo = new Map<ChainId, ProtocolConfig["nativeCoin"]>([
[137, { decimals: "18", name: "Matic", symbol: "MATIC" }],
[1, { decimals: "18", name: "Ether", symbol: "ETH" }],
[5, { decimals: "18", name: "GTH", symbol: "GTH" }],
[11155111, { decimals: "18", name: "sETH", symbol: "sETH" }],
[31337, { decimals: "18", name: "Ether", symbol: "ETH" }]
]);

Expand Down Expand Up @@ -39,6 +40,15 @@ export const chainIdToGraphTx = new Map<
return `https://goerli.etherscan.io/tx/${txHash}`;
}
],
[
11155111,
(txHash = "", isAddress = false) => {
if (isAddress) {
return `https://sepolia.etherscan.io/address/${txHash}`;

Check warning on line 47 in packages/common/src/mappings.ts

View check run for this annotation

Codecov / codecov/patch

packages/common/src/mappings.ts#L45-L47

Added lines #L45 - L47 were not covered by tests
}
return `https://sepolia.etherscan.io/tx/${txHash}`;

Check warning on line 49 in packages/common/src/mappings.ts

View check run for this annotation

Codecov / codecov/patch

packages/common/src/mappings.ts#L49

Added line #L49 was not covered by tests
}
],
[
1,
(txHash = "", isAddress = false) => {
Expand Down Expand Up @@ -173,6 +183,41 @@ export const chainIdToDefaultTokens = new Map<ChainId, Token[]>([
}
]
],
[
11155111,
[
{
symbol: "ETH",
name: "ETH",
address: "0x0000000000000000000000000000000000000000",
decimals: "18"
},
{
symbol: "BOSON",
name: "Boson Token (PoS)",
address: "0xffffffffffffffffffffffffffffffffffffffff", // TODO: change it
decimals: "18"
},
{
symbol: "USDC",
name: "USD Coin",
address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
decimals: "6"
},
{
symbol: "DAI",
name: "Dai Stablecoin",
address: "0x3e622317f8C93f7328350cF0B56d9eD4C620C5d6",
decimals: "18"
},
{
symbol: "USDT",
name: "Tether USD",
address: "0xaA8E23Fb1079EA71e0a56F48a2aA51851D8433D0",
decimals: "6"
}
]
],
[
137,
[
Expand Down
2 changes: 2 additions & 0 deletions packages/common/src/types/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ export type ConfigId =
| "local-31337-0"
| "testing-80001-0"
| "testing-5-0"
| "testing-11155111-0"
| "staging-80001-0"
| "staging-5-0"
| "staging-11155111-0"
| "production-137-0"
| "production-1-0";

Expand Down
9 changes: 9 additions & 0 deletions packages/react-kit/src/lib/const/chainInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ const CHAIN_INFO: ChainInfoMap = {
logoUrl: ethereumLogoUrl,
nativeCurrency: { name: "Görli Ether", symbol: "görETH", decimals: 18 }
},
[ChainId.SEPOLIA]: {
networkType: NetworkType.L1,
docs: "https://docs.uniswap.org/",
explorer: "https://sepolia.etherscan.io/",
infoLink: "https://info.uniswap.org/#/",
label: "Sepolia",
logoUrl: ethereumLogoUrl,
nativeCurrency: { name: "Sepolia Ether", symbol: "sETH", decimals: 18 }
},
[ChainId.POLYGON]: {
networkType: NetworkType.L1,
blockWaitMsBeforeWarning: ms(`10m`),
Expand Down
10 changes: 10 additions & 0 deletions packages/react-kit/src/lib/opensea/getOpenSeaUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const openSeaUrlMap = new Map([
"testing-5-0",
(tokenId: string, contractAddress: string) =>
`https://testnets.opensea.io/assets/goerli/${contractAddress}/${tokenId}`
],
[
"testing-11155111-0",
(tokenId: string, contractAddress: string) =>
`https://testnets.opensea.io/assets/sepolia/${contractAddress}/${tokenId}`
]
])
],
Expand All @@ -30,6 +35,11 @@ const openSeaUrlMap = new Map([
"staging-5-0",
(tokenId: string, contractAddress: string) =>
`https://testnets.opensea.io/assets/goerli/${contractAddress}/${tokenId}`
],
[
"staging-11155111-0",
(tokenId: string, contractAddress: string) =>
`https://testnets.opensea.io/assets/sepolia/${contractAddress}/${tokenId}`
]
])
],
Expand Down
8 changes: 4 additions & 4 deletions packages/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
"manifest": "ts-node -P ../../tsconfig.base.json ./scripts/render-manifest.ts",
"manifest:local": "npm run manifest -- local local-31337-0 && npm run codegen",
"manifest:testing": "npm run manifest -- testing testing-80001-0 && npm run codegen",
"manifest:testing:goerli": "npm run manifest -- testing testing-5-0 && npm run codegen",
"manifest:testing:sepolia": "npm run manifest -- testing testing-11155111-0 && npm run codegen",
"manifest:staging": "npm run manifest -- staging staging-80001-0 && npm run codegen",
"manifest:staging:goerli": "npm run manifest -- staging staging-5-0 && npm run codegen",
"manifest:staging:sepolia": "npm run manifest -- staging staging-11155111-0 && npm run codegen",
"manifest:production": "npm run manifest -- production production-137-0 && npm run codegen",
"manifest:production:ethereum": "npm run manifest -- production production-1-0 && npm run codegen",
"codegen": "graph codegen",
"create:local": "graph create --node http://localhost:8020/ boson/corecomponents",
"remove:local": "graph remove --node http://localhost:8020/ boson/corecomponents",
"deploy:local": "npm run manifest:local && npm run create:local && graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 boson/corecomponents -l 0.0.1",
"deploy:testing": "npm run manifest:testing && graph deploy --node https://api.thegraph.com/deploy/ --product hosted-service --ipfs https://api.thegraph.com/ipfs/ bosonprotocol/mumbai-testing",
"deploy:testing:goerli": "npm run manifest:testing:goerli && graph deploy --node https://api.thegraph.com/deploy/ --product hosted-service --ipfs https://api.thegraph.com/ipfs/ bosonprotocol/goerli-testing",
"deploy:testing:sepolia": "npm run manifest:testing:sepolia && graph deploy --node https://api.thegraph.com/deploy/ --product hosted-service --ipfs https://api.thegraph.com/ipfs/ bosonprotocol/sepolia-testing",
"deploy:staging": "npm run manifest:staging && graph deploy --node https://api.thegraph.com/deploy/ --product hosted-service --ipfs https://api.thegraph.com/ipfs/ bosonprotocol/mumbai-staging",
"deploy:staging:goerli": "npm run manifest:staging:goerli && graph deploy --node https://api.thegraph.com/deploy/ --product hosted-service --ipfs https://api.thegraph.com/ipfs/ bosonprotocol/goerli-staging",
"deploy:staging:sepolia": "npm run manifest:staging:sepolia && graph deploy --node https://api.thegraph.com/deploy/ --product hosted-service --ipfs https://api.thegraph.com/ipfs/ bosonprotocol/sepolia-staging",
"deploy:production": "npm run manifest:production && graph deploy --node https://api.thegraph.com/deploy/ --product hosted-service --ipfs https://api.thegraph.com/ipfs/ bosonprotocol/polygon",
"deploy:production:ethereum": "npm run manifest:production:ethereum && graph deploy --node https://api.thegraph.com/deploy/ --product hosted-service --ipfs https://api.thegraph.com/ipfs/ bosonprotocol/ethereum",
"test": "npm run manifest:local && graph test"
Expand Down
8 changes: 8 additions & 0 deletions packages/subgraph/scripts/render-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const envNameToConfig: Record<
"testing-5-0": {
network: "goerli",
startBlock: 9757131 // goerli, block number when protocol was deployed https://goerli.etherscan.io/tx/0x3c51e116a6a1849936e6bd45fcee78017259ce86a93601e5e7c77cbdc25b6f38
},
"testing-11155111-0": {
network: "sepolia",
startBlock: 5517165 // sepolia, block number when protocol was deployed https://sepolia.etherscan.io/tx/0x755c74e6c8717d4385d65b22ddf46b885030cd4289ed072a58d26efeab1b77c1
}
},
staging: {
Expand All @@ -49,6 +53,10 @@ const envNameToConfig: Record<
"staging-5-0": {
network: "goerli",
startBlock: 9756834 // goerli, block number when protocol was deployed https://goerli.etherscan.io/tx/0x7d4b731fc8b9fe77999f46a52891f2bd13651666bb9a15d7044b33bddd52b355
},
"staging-11155111-0": {
network: "sepolia",
startBlock: 5519001 // TODO: change it
}
},
production: {
Expand Down

0 comments on commit bc20121

Please sign in to comment.