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

fix: Polygon amoy references #108

Merged
merged 2 commits into from
May 8, 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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| Matic Temp | Hosted Services | https://thegraph.com/explorer/subgraph/decentraland/collections-matic-mainnet-temp | QmTKztw187jUHZ33S2pndtyo68K462XwewcvMVAVH7mwZR | Qmf3igvJs24gozdwCwnDyPNz9DEBQMPQRFmEhUzEvgxZSq |
| Mumbai | Satsuma | https://subgraph.satsuma-prod.com/decentraland/collections-matic-mumbai/playground | QmdqoM3jpJWWbK1EMTZcSE5WJgiUaoSpKcSLeQRHhqQSea | QmYVGaMGvqkcBMrJ4F5XrkzwCzhB3FfJvHRBERbtgovCai |
| Mumbai | Hosted Service | https://thegraph.com/explorer/subgraph/decentraland/collections-matic-mumbai | QmdqoM3jpJWWbK1EMTZcSE5WJgiUaoSpKcSLeQRHhqQSea | QmYVGaMGvqkcBMrJ4F5XrkzwCzhB3FfJvHRBERbtgovCai |
| Amoy | Satsuma | https://subgraph.satsuma-prod.com/decentraland/collections-matic-amoy/playground | QmZKxA9VfjFTDNbNDASec194y3rZxiamtEMakWaoFaD8ov | Qma6T1cGQtBvYY5bsctwLNSbNymXKidkXaC9DbQVTgH1BE |
| Amoy | Satsuma | https://subgraph.satsuma-prod.com/decentraland/collections-matic-amoy/playground | QmeJBtfn5mgPH2CbRJpWbwUBmjg64vxTA5KTERaHUtG15u | QmZKxA9VfjFTDNbNDASec194y3rZxiamtEMakWaoFaD8ov |

Using [The Graph](https://thegraph.com) and [Alchemy](https://www.alchemy.com/)

Expand Down
2 changes: 1 addition & 1 deletion src/modules/catalyst/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function getCatalystBase(): string {
return 'https://peer.decentraland.org'
}

if (network == 'ropsten' || network == 'goerli' || network == 'sepolia' || network == 'mumbai') {
if (network == 'ropsten' || network == 'goerli' || network == 'sepolia' || network == 'mumbai' || network == 'polygon-amoy') {
Copy link
Contributor

Choose a reason for hiding this comment

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

why "polygon-amoy" and not "amoy"?

return 'https://peer.decentraland.zone'
}

Expand Down
4 changes: 4 additions & 0 deletions src/modules/curation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ export function getBlockWhereRescueItemsStarted(): BigInt {
return BigInt.fromI32(19885000)
}

if (network == 'amoy') {
return BigInt.fromI32(5706678)
}

return BigInt.fromI32(I32.MAX_VALUE)
}
2 changes: 1 addition & 1 deletion src/modules/network/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { dataSource } from '@graphprotocol/graph-ts'

export function getNetwork(): string {
let network = dataSource.network()
return network == "mainnet" ? "ethereum" : network
return network == "mainnet" ? "ethereum" : network == 'polygon-amoy' ? 'amoy' : network
}
6 changes: 4 additions & 2 deletions src/modules/rarity/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ import { Rarity } from '../../entities/schema'
let ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
let RARITY_MUMBAI = '0x8eabf06f6cf667915bff30138be70543bce2901a'
let RARITY_MATIC = '0x17113b44fdd661a156cc01b5031e3acf72c32eb3'
let RARITY_AMOY = '0xddb3781fff645325c8896aa1f067baa381607ecc'
let RARITIES_WITH_ORACLE_MUMBAI = '0xb9957735bbe6d42585058af11aa72da8ead9043a'
let RARITIES_WITH_ORACLE_MATIC = '0xa9158e22f89bb3f69c5600338895cb5fb81e5090'
let RARITIES_WITH_ORACLE_AMOY = '0x25b6b4bac4adb582a0abd475439da6730777fbf7'

export function getRarityAddress(): Address {
let network = dataSource.network()
let addressString = network == 'mumbai' ? RARITY_MUMBAI : network == 'matic' ? RARITY_MATIC : ZERO_ADDRESS
let addressString = network == 'polygon-amoy' ? RARITY_AMOY : network == 'mumbai' ? RARITY_MUMBAI : network == 'matic' ? RARITY_MATIC : ZERO_ADDRESS

return Address.fromString(addressString)
}

export function getRaritiesWithOracleAddress(): Address {
let network = dataSource.network()
let addressString = network == 'mumbai' ? RARITIES_WITH_ORACLE_MUMBAI : network == 'matic' ? RARITIES_WITH_ORACLE_MATIC : ZERO_ADDRESS
let addressString = network == 'polygon-amoy' ? RARITIES_WITH_ORACLE_AMOY : network == 'mumbai' ? RARITIES_WITH_ORACLE_MUMBAI : network == 'matic' ? RARITIES_WITH_ORACLE_MATIC : ZERO_ADDRESS

return Address.fromString(addressString)
}
Expand Down
4 changes: 4 additions & 0 deletions src/modules/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export function getStoreAddress(): string {
return '0x6ddf1b1924dad850adbc1c02026535464be06b0c'
}

if (network == 'polygon-amoy') {
return '0xe36abc9ec616c83caaa386541380829106149d68'
}

log.debug('Could not find store address. Invalid network {}', [network])
return ''
}
Loading