Skip to content

Commit

Permalink
Merge pull request #308 from gnosisguild/fix-subgraph-error
Browse files Browse the repository at this point in the history
Fix subgraph overflow error
  • Loading branch information
jfschwarz authored Dec 6, 2024
2 parents ceed286 + a253f0b commit e13dfbe
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 31 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,17 @@ Address: `0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1`

#### Subgraphs

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

### Development environment setup

Expand Down
1 change: 1 addition & 0 deletions packages/app/app/[mod]/roles/[role]/fetching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ const newRole = (roleKey: `0x${string}`): Role => ({
members: [],
targets: [],
annotations: [],
lastUpdate: 0,
})
1 change: 1 addition & 0 deletions packages/app/components/RoleView/fetching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ const newRole = (roleKey: `0x${string}`): Role => ({
members: [],
targets: [],
annotations: [],
lastUpdate: 0,
})
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.3.3",
"version": "2.3.4",
"license": "LGPL-3.0+",
"main": "build/cjs/index.js",
"module": "build/esm/index.js",
Expand Down
22 changes: 11 additions & 11 deletions packages/deployments/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,66 @@ export const chains = {
name: "mainnet",
prefix: "eth",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-mainnet/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-mainnet/v2.3.2",
},
[10]: {
name: "optimism",
prefix: "oeth",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-optimism/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-optimism/v2.3.2",
},
[100]: {
name: "gnosis",
prefix: "gno",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-gnosis/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-gnosis/v2.3.2",
},
[137]: {
name: "polygon",
prefix: "matic",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-polygon/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-polygon/v2.3.2",
},
[1101]: {
name: "zkevm",
prefix: "zkevm",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-zkevm/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-zkevm/v2.3.2",
},
[42161]: {
name: "arbitrumOne",
prefix: "arb1",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-arbitrum-one/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-arbitrum-one/v2.3.2",
},
[43114]: {
name: "avalanche",
prefix: "avax",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-avalanche/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-avalanche/v2.3.2",
},
[56]: {
name: "bsc",
prefix: "bnb",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-bsc/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-bsc/v2.3.2",
},
[8453]: {
name: "base",
prefix: "base",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-base/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-base/v2.3.2",
},
[84532]: {
name: "baseSepolia",
prefix: "basesep",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-base-sepolia/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-base-sepolia/v2.3.2",
},
[11155111]: {
name: "sepolia",
prefix: "sep",
subgraph:
"https://api.studio.thegraph.com/query/93263/zodiac-roles-sepolia/v2.3.1",
"https://api.studio.thegraph.com/query/93263/zodiac-roles-sepolia/v2.3.2",
},
} as const
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zodiac-roles-sdk",
"version": "2.17.0",
"version": "2.18.0",
"license": "LGPL-3.0+",
"main": "build/cjs/sdk/src/index.js",
"module": "build/esm/sdk/src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export { encodeCalls } from "./calls"
export * from "./targets"
export * from "./annotations"
export { applyMembers } from "./members"
export { setUpRolesMod } from "./setup"
export { setUpRoles, setUpRolesMod } from "./setup"

export * from "./ethSdk"
export * from "./abi"
Expand Down
4 changes: 2 additions & 2 deletions packages/subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ type Allowance @entity {
id: ID! # Global unique id
key: Bytes! # Unique within the Roles modifier instance (bytes32)
rolesModifier: RolesModifier!
period: Int! # duration of the period in seconds, 0 for one-time allowance
period: BigInt! # duration of the period in seconds, 0 for one-time allowance
refill: BigInt! # amount that will be replenished "at the start of every period" (replace with: per period)
timestamp: Int! # timestamp of the last interval refilled for;
timestamp: BigInt! # timestamp of the last interval refilled for;
maxRefill: BigInt! # max accrual amount, replenishing stops once the unused allowance hits this value
balance: BigInt! # unused allowance;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/subgraph/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export const getOrCreateAllowance = (allowanceKey: Bytes, rolesModifierId: strin
allowance.balance = BigInt.fromU32(0)
allowance.maxRefill = BigInt.fromU32(0)
allowance.refill = BigInt.fromU32(0)
allowance.period = 0
allowance.timestamp = 0
allowance.period = BigInt.fromU32(0)
allowance.timestamp = BigInt.fromU32(0)
allowance.save()
}
return allowance
Expand Down
4 changes: 2 additions & 2 deletions packages/subgraph/src/permissions.mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ export function handleSetAllowance(event: SetAllowance): void {
allowance.balance = event.params.balance
allowance.refill = event.params.refill
allowance.maxRefill = event.params.maxRefill
allowance.period = event.params.period.toU32()
allowance.timestamp = event.params.timestamp.toU32()
allowance.period = event.params.period
allowance.timestamp = event.params.timestamp
allowance.save()

log.info("Allowance {} has been set", [allowance.id])
Expand Down

0 comments on commit e13dfbe

Please sign in to comment.