Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add sepolia config and subgraph #686

Merged
merged 6 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/deploy-staging-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ jobs:
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
2 changes: 2 additions & 0 deletions .github/workflows/deploy-testing-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jobs:
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.INFURA_PROJECT_SECRET }}

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.INFURA_PROJECT_SECRET }}

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.INFURA_PROJECT_SECRET }}

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.INFURA_PROJECT_SECRET }}

echo "Pin for production/polygon env..."
npm run pin-to-pinata -- \
-e production \
Expand Down
102 changes: 102 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/common/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const baseConfig = require("../../jest.config.sdk");

baseConfig.transform = {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: "tsconfig.tests.json"
}
]
};

module.exports = baseConfig;
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
},
levalleux-ludo marked this conversation as resolved.
Show resolved Hide resolved
{
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",
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}`;
}
return `https://sepolia.etherscan.io/tx/${txHash}`;
}
],
[
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: "0x791Bf9Da3DEF5D7Cd3A7a748e56720Cd119D53AC",
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
Loading
Loading