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

Feat/subgraph changes only #560

Merged
merged 4 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"**/@graphprotocol/graph-cli",
"**/@graphprotocol/graph-cli/**",
"**/matchstick-as",
"**/matchstick-as/**"
"**/matchstick-as/**",
"**/@aragon/osx-commons-subgraph",
"**/@aragon/osx-commons-subgraph/**"
]
}
}
39 changes: 38 additions & 1 deletion packages/subgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UPCOMING]

## 1.4.1

## 1.5.0

### Changed

- Fixed bug with negative number balances and missing delegation history for existing ERC20 tokens using `TokenVoting`
- Fixed bugs regarding inconsistent memberIds in various parts of the codebase. This primarily affects delegation.

### Changed

- Removed `createERC1155TokenCalls`, `createTokenCalls`, `createWrappedTokenCalls` and `createDummyActions` and use the equivalent functions `createERC20TokenCalls`, `createERC1155TokenCalls` and `createDummyAction` from `@aragon/sdk-commons-subgraph`
- Used `createDummyAction` from `@aragon/sdk-commons-subgraph`

## 1.4.0

### Added

- Added `isSignaling` attribute to `TokenVotingProposal`, `AddresslistVotingProposal`, and `MultisigProposal` that is set to true for proposals having an empty action array.

### Changed

- Renamed `potentiallyExecutable` attribute to `approvalReached` and stopped setting it to `true` during multisig proposal creation if `minApprovals = 1` when zero approvals were given yet.

## 1.3.1

### Added

- Add support for `Granted` & `Revoked` event in `PluginRepo`
- Add one-to-many relationship from `Dao` & `PluginRepo` to `Permission`

### Changed

- Renamed `fetchERC20` & `fetchWrappedERC20` to `fetchOrCreateERC20Entity` & `fetchOrCreateWrappedERC20Entity` respectively.
- Changed type of `token` attribute of `ERC20Transfer` from `ERC20Contract` to `Token`.
- Refactored `Permission` entity & added `pluginRepo` attribute.
- Fixed wrong token voting member deletion, when balance & voting power was zero, but it was still delegating to another address.

### Removed

- Removed `SignatureValidatorSet` event.
- Removed `ContractPermissionId` entity.

## [1.3.0]

### Added
Expand Down Expand Up @@ -69,7 +106,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Changed `IPluginInstallation` to `IPlugin`.
- Changed `release: Int!` to `release: PluginRelease!` in `PluginVersion`
- Changed `versions` to `releases` in `PluginRepo`.
- Changes `Permission` entity to be muteable.
- Changes `Permission` entity to be mutable.

### Removed

Expand Down
23 changes: 19 additions & 4 deletions packages/subgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ You have the option to deploy your subgraph locally, this is how you can do it.

Make sure u set the env variable `<NETWORK_NAME>` to 'localhost' and `<SUBGRAPH_NAME>` to 'aragon/aragon-core'.

To update the local manifest after the contracts have been compiled,
To update the local manifest after the contracts have been compiled,

```console
yarn updateLocalManifest
```
Expand All @@ -81,11 +82,13 @@ To start:
yarn start:dev
```

When there's changes in the contract's package, run
When there are changes in the contract's package, run

```console
yarn buildAndStart:dev
```
to force build the hardhat docker image containing the contracts.
```

to force build the hardhat docker image containing the contracts.

Ideally in the future, the docker image should be part of the contract's CI/CD flow. Each time a new version of contracts is released, a new docker image should also be released, and the version number should be changed on the docker-compose in the subgraph directory.

Expand All @@ -111,3 +114,15 @@ yarn stop:dev
| subgraph:patch | Applies a patch version bump for the changelog and package.json |
| subgraph:minor | Applies a minor version bump for the changelog and package.json |
| subgraph:major | Applies a major version bump for the changelog and package.json |

## Contributing

If you like what we're doing and would love to support, please review our `CONTRIBUTING_GUIDE.md` [here](https://github.com/aragon/osx/blob/develop/CONTRIBUTION_GUIDE.md). We'd love to build with you.

## Security

If you believe you've found a security issue, we encourage you to notify us. We welcome working with you to resolve the issue promptly.

Security Contact Email: [email protected]

Please do not use the issue tracker for security issues.
20 changes: 8 additions & 12 deletions packages/subgraph/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: '3'
services:
hardhat:
build:
context: ../../../
dockerfile: packages/subgraph/docker/hardhat.Dockerfile
ports:
- 8545:8545
build:
context: ../../../
dockerfile: packages/subgraph/docker/hardhat.Dockerfile
ports:
- 8545:8545
graph-node:
image: graphprotocol/graph-node
ports:
Expand Down Expand Up @@ -38,19 +38,15 @@ services:
image: postgres
ports:
- '5432:5432'
command:
[
"postgres",
"-cshared_preload_libraries=pg_stat_statements"
]
command: ['postgres', '-cshared_preload_libraries=pg_stat_statements']
environment:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node
# FIXME: remove this env. var. which we shouldn't need. Introduced by
# <https://github.com/graphprotocol/graph-node/pull/3511>, maybe as a
# workaround for https://github.com/docker/for-mac/issues/6270?
PGDATA: "/var/lib/postgresql/data"
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C"
PGDATA: '/var/lib/postgresql/data'
POSTGRES_INITDB_ARGS: '-E UTF8 --locale=C'
volumes:
- ./data/postgres:/var/lib/postgresql/data
43 changes: 21 additions & 22 deletions packages/subgraph/manifest/data/arbitrumSepolia.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
{
"info": "# Do not edit subgraph.yaml,this is a generated file. \n# Instead, edit subgraph.placeholder.yaml and run: yarn manifest",
"network": "arbitrum-sepolia",
"dataSources": {
"DAORegistry": {
"name": "DAORegistry",
"address": "0x308a1DC5020c4B5d992F5543a7236c465997fecB",
"startBlock": 2827166
},
"PluginRepoRegistry": {
"name": "PluginRepoRegistry",
"address": "0x35B62715459cB60bf6dC17fF8cfe138EA305E7Ee",
"startBlock": 2827170
},
"PluginSetupProcessors": [
{
"name": "PluginSetupProcessor",
"address": "0xC24188a73dc09aA7C721f96Ad8857B469C01dC9f",
"startBlock": 2827173
}
]
}
"info": "# Do not edit subgraph.yaml,this is a generated file. \n# Instead, edit subgraph.placeholder.yaml and run: yarn manifest",
"network": "arbitrum-sepolia",
"dataSources": {
"DAORegistry": {
"name": "DAORegistry",
"address": "0x308a1DC5020c4B5d992F5543a7236c465997fecB",
"startBlock": 2827166
},
"PluginRepoRegistry": {
"name": "PluginRepoRegistry",
"address": "0x35B62715459cB60bf6dC17fF8cfe138EA305E7Ee",
"startBlock": 2827170
},
"PluginSetupProcessors": [
{
"name": "PluginSetupProcessor",
"address": "0xC24188a73dc09aA7C721f96Ad8857B469C01dC9f",
"startBlock": 2827173
}
]
}
}
11 changes: 9 additions & 2 deletions packages/subgraph/manifest/subgraph.placeholder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ templates:
file: $ARAGON_OSX_MODULE/../subgraph/abis/DAO_v1_0_0.json
- name: CallbackHandler
file: $ARAGON_OSX_MODULE/artifacts/src/core/utils/CallbackHandler.sol/CallbackHandler.json
- name: GovernanceWrappedERC20
file: $ARAGON_OSX_MODULE/artifacts/src/token/ERC20/governance/GovernanceWrappedERC20.sol/GovernanceWrappedERC20.json
eventHandlers:
- event: MetadataSet(bytes)
handler: handleMetadataSet
Expand All @@ -142,8 +144,6 @@ templates:
handler: handleTrustedForwarderSet
- event: StandardCallbackRegistered(bytes4,bytes4,bytes4)
handler: handleStandardCallbackRegistered
- event: SignatureValidatorSet(address)
handler: handleSignatureValidatorSet
- event: NewURI(string)
handler: handleNewURI
- name: DaoTemplateV1_3_0
Expand Down Expand Up @@ -175,6 +175,8 @@ templates:
file: $ARAGON_OSX_MODULE/artifacts/src/plugins/governance/majority-voting/addresslist/AddresslistVoting.sol/AddresslistVoting.json
- name: CallbackHandler
file: $ARAGON_OSX_MODULE/artifacts/src/core/utils/CallbackHandler.sol/CallbackHandler.json
- name: GovernanceWrappedERC20
file: $ARAGON_OSX_MODULE/artifacts/src/token/ERC20/governance/GovernanceWrappedERC20.sol/GovernanceWrappedERC20.json
eventHandlers:
- event: Executed(indexed address,bytes32,(address,uint256,bytes)[],uint256,uint256,bytes[])
handler: handleExecuted
Expand Down Expand Up @@ -357,3 +359,8 @@ templates:
handler: handleVersionCreated
- event: ReleaseMetadataUpdated(uint8,bytes)
handler: handleReleaseMetadataUpdated
- event: Granted(indexed bytes32,indexed address,address,indexed address,address)
handler: handleGranted
- event: Revoked(indexed bytes32,indexed address,address,indexed address)
handler: handleGranted

11 changes: 6 additions & 5 deletions packages/subgraph/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aragon/osx-subgraph",
"version": "1.3.0",
"version": "1.4.1",
"description": "The Aragon OSx Subgraph",
"homepage": "https://github.com/aragon/osx",
"license": "AGPL-3.0-or-later",
Expand All @@ -19,19 +19,20 @@
"buildAndStart:dev": "docker-compose -f docker/docker-compose.yml up -d --build hardhat && sleep 30 && yarn create:local && yarn deploy:local",
"test:fast": "graph test",
"test": "graph test -r",
"coverage": "graph test -c",
"formatting:check": "prettier '**/*.{json,ts,js}' -c",
"formatting:write": "prettier '**/*.{json,ts,js}' --write"
"coverage": "graph test -c"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.52.0",
"@graphprotocol/graph-ts": "^0.27.0",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"eslint": "^8.12.0",
"matchstick-as": "^0.5.1",
"matchstick-as": "^0.5.2",
"mustache": "^4.2.0",
"ts-morph": "^17.0.1",
"typescript": "^4.9.5"
},
"dependencies": {
"@aragon/osx-commons-subgraph": "^0.0.4"
}
}
Loading
Loading