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

Move from kovan to goerli #199

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Synthetix currently maintains one official subgraph per network on the hosted se

### Hosted Service

The Synthetix subgraph is available on the hosted service on **[mainnet](https://thegraph.com/hosted-service/subgraph/synthetixio-team/mainnet-main)**, **[optimism](https://thegraph.com/hosted-service/subgraph/synthetixio-team/optimism-main)**, **[kovan](https://thegraph.com/hosted-service/subgraph/synthetixio-team/kovan-main)**, and **[optimism-kovan](https://thegraph.com/hosted-service/subgraph/synthetixio-team/optimism-kovan-main)**
The Synthetix subgraph is available on the hosted service on **[mainnet](https://thegraph.com/hosted-service/subgraph/synthetixio-team/mainnet-main)**, **[optimism](https://thegraph.com/hosted-service/subgraph/synthetixio-team/optimism-main)**, **[goerli](https://thegraph.com/hosted-service/subgraph/synthetixio-team/goerli-main)**, and **[optimism-goerli](https://thegraph.com/hosted-service/subgraph/synthetixio-team/optimism-goerli-main)**

**⚠️ Using subgraphs with the hosted service may introduce breaking changes.** The Synthetix subgraphs are under active development. Because The Graph does not currently support pinning subgraph versions on the hosted service, these subgraphs should be used with caution.

Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ program
.option('--graft-block <number>', 'Block to begin the graft. 0 disables grafting');

program.action(async () => {
const NETWORK_CHOICES = ['mainnet', 'kovan', 'optimism', 'optimism-kovan'];
const NETWORK_CHOICES = ['mainnet', 'goerli', 'optimism', 'optimism-goerli'];
const SUBGRAPH_CHOICES = await fs.readdirSync(path.join(__dirname, '../subgraphs')).reduce((acc, val) => {
if (val.endsWith('.js') && val !== 'main.js') {
acc.push(val.slice(0, -3));
Expand Down
8 changes: 4 additions & 4 deletions scripts/helpers/create-contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ interface ContractInfo { address: string };
export function getContractDeployment(contractName: string, network: string, block: BigInt): Address | null {
`);

for (const network of ['mainnet', 'mainnet-ovm', 'kovan', 'kovan-ovm']) {
for (const network of ['mainnet', 'mainnet-ovm', 'goerli', 'goerli-ovm']) {
const versions = require(`synthetix/publish/deployed/${network}/versions.json`);

let networkName;
switch (network) {
case 'mainnet':
case 'kovan':
case 'goerli':
networkName = network;
break;
case 'mainnet-ovm':
networkName = 'optimism';
break;
case 'kovan-ovm':
networkName = 'optimism-kovan';
case 'goerli-ovm':
networkName = 'optimism-goerli';
break;
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers/prepare-abis.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const snx = require('synthetix');

program.action(async () => {
const abiPath = path.join(__dirname, '../../abis');
const sources = snx.getSource({ network: 'kovan' });
const sources = snx.getSource({ network: 'goerli' });

const doesEntryHaveMultidimensionalArrays = ({ type }) => /\[[0-9]*\]\[[0-9]*\]/.test(type);

Expand Down
5 changes: 4 additions & 1 deletion subgraphs/exchanger.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ getContractDeployments('Exchanger').forEach((a, i) => {

// add synthetix (only the new contracts)
getContractDeployments('ProxyERC20').forEach((a, i) => {
if (i === 0 && (getCurrentNetwork() !== 'optimism' || getCurrentNetwork() !== 'optimism-kovan')) {
if (
(i === 0 && (getCurrentNetwork() !== 'optimism' || getCurrentNetwork() !== 'optimism-goerli')) ||
getCurrentNetwork() !== 'goerli'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I assumed that guerli doesn't need to track exchanger_SynthetixOldTracking

) {
manifest.push({
kind: 'ethereum/contract',
name: 'exchanger_SynthetixOldTracking',
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/fragments/latest-rates.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ exchangeRatesContractAddresses.forEach((ca, i) => {
});
});

if (getCurrentNetwork() === 'mainnet' || getCurrentNetwork() == 'kovan') {
if (getCurrentNetwork() === 'mainnet' || getCurrentNetwork() == 'goerli') {
// hack for chainlink, tracking of aggregator address changes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this chainlink hack is required for goerli too?

exchangeRatesManifests.push({
kind: 'ethereum/contract',
Expand Down
11 changes: 6 additions & 5 deletions subgraphs/utils/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ function getReleaseInfo(file, network = undefined) {
const net = network || getCurrentNetwork();

let info = null;
if (net === 'mainnet' || net === 'kovan') {
if (net === 'mainnet' || net === 'goerli') {
return require('synthetix/publish/deployed/' + net + '/' + file);
} else if (net === 'optimism') {
return require('synthetix/publish/deployed/mainnet-ovm/' + file);
} else if (net === 'optimism-kovan') {
return require('synthetix/publish/deployed/kovan-ovm/' + file);
} else if (net === 'optimism-goerli') {
return require('synthetix/publish/deployed/goerli-ovm/' + file);
}

return info;
Expand Down Expand Up @@ -108,7 +108,8 @@ function getContractDeployments(contractName, startBlock = 0, endBlock = Number.
let contractStartBlock = Math.max(info.block || estimateBlock(info.date), BLOCK_SAFETY_OFFSET);

// Relevant information is missing from the kovan versions.json file, so we hardcode a minimum here
if (network == 'kovan' || getCurrentNetwork() == 'kovan') {
if (network == 'goerli' || getCurrentNetwork() == 'goerli') {
// TODO ask someone if this still is needed, and if it is what block to use
contractStartBlock = Math.max(contractStartBlock, 10412700);
0xjocke marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down Expand Up @@ -171,7 +172,7 @@ function createSubgraphManifest(name, dataSources, templates) {
return manifest;
}

const NETWORKS = ['mainnet', 'kovan', 'optimism-kovan', 'optimism'];
const NETWORKS = ['mainnet', 'goerli', 'optimism-goerli', 'optimism'];

module.exports = {
getCurrentNetwork,
Expand Down