Skip to content

Commit

Permalink
fix & release subgraph + bump deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Jun 24, 2024
1 parent 99e60f9 commit ba006c2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ Address: `0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1`

#### Subgraphs

- [Mainnet](https://api.studio.thegraph.com/query/23167/zodiac-roles-mainnet/v2.2.2)
- [Optimism](https://api.studio.thegraph.com/query/23167/zodiac-roles-optimism/v2.2.2)
- [Gnosis](https://api.studio.thegraph.com/query/23167/zodiac-roles-gnosis/v2.2.2)
- [Polygon](https://api.studio.thegraph.com/query/23167/zodiac-roles-polygon/v2.2.2)
- [Arbitrum One](https://api.studio.thegraph.com/query/23167/zodiac-roles-arbitrum-one/v2.2.2)
- [Avalanche C-Chain](https://api.studio.thegraph.com/query/23167/zodiac-roles-avalanche/v2.2.2)
- [Base](https://api.studio.thegraph.com/query/23167/zodiac-roles-base/v2.2.2)
- [Sepolia](https://api.studio.thegraph.com/query/23167/zodiac-roles-sepolia/v2.2.2)
- [Mainnet](https://api.studio.thegraph.com/query/23167/zodiac-roles-mainnet/v2.2.3)
- [Optimism](https://api.studio.thegraph.com/query/23167/zodiac-roles-optimism/v2.2.3)
- [Gnosis](https://api.studio.thegraph.com/query/23167/zodiac-roles-gnosis/v2.2.3)
- [Polygon](https://api.studio.thegraph.com/query/23167/zodiac-roles-polygon/v2.2.3)
- [Arbitrum One](https://api.studio.thegraph.com/query/23167/zodiac-roles-arbitrum-one/v2.2.3)
- [Avalanche C-Chain](https://api.studio.thegraph.com/query/23167/zodiac-roles-avalanche/v2.2.3)
- [Base](https://api.studio.thegraph.com/query/23167/zodiac-roles-base/v2.2.3)
- [Sepolia](https://api.studio.thegraph.com/query/23167/zodiac-roles-sepolia/v2.2.3)

### Development environment setup

Expand Down
2 changes: 1 addition & 1 deletion packages/deployments/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zodiac-roles-deployments",
"version": "2.2.4",
"version": "2.2.5",
"license": "LGPL-3.0+",
"main": "build/cjs/index.js",
"module": "build/esm/index.js",
Expand Down
17 changes: 11 additions & 6 deletions packages/subgraph/src/periphery.mapping.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { log } from "@graphprotocol/graph-ts"
import { store, log } from "@graphprotocol/graph-ts"
import { SetUnwrapAdapter } from "../generated/Periphery/Periphery"
import { getOrCreateUnwrapAdapter, getRolesModifierId } from "./helpers"
import { getOrCreateUnwrapAdapter, getRolesModifierId, ADDRESS_ZERO, getUnwrapAdapterId } from "./helpers"

export function handleSetUnwrapAdapter(event: SetUnwrapAdapter): void {
const rolesModifierAddress = event.address
const rolesModifierId = getRolesModifierId(rolesModifierAddress)

const adapter = getOrCreateUnwrapAdapter(event.params.to, event.params.selector, rolesModifierId)
adapter.adapterAddress = event.params.adapter
adapter.save()

log.info("UnwrapAdapter {} has been set to {}", [adapter.id, adapter.adapterAddress.toHexString()])
if (event.params.adapter == ADDRESS_ZERO) {
const id = getUnwrapAdapterId(event.params.to, event.params.selector, rolesModifierId)
store.remove("UnwrapAdapter", id)
log.info("UnwrapAdapter {} has been removed", [id])
} else {
adapter.adapterAddress = event.params.adapter
adapter.save()
log.info("UnwrapAdapter {} has been set to {}", [adapter.id, adapter.adapterAddress.toHexString()])
}
}

0 comments on commit ba006c2

Please sign in to comment.