Skip to content

Commit

Permalink
Merge branch 'develop' into feature/update-subgraph-DevPortal-docs-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
banasa44 committed Apr 2, 2024
2 parents a8be045 + 7faed0d commit 9f5f974
Show file tree
Hide file tree
Showing 15 changed files with 341 additions and 121 deletions.
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Description

Please include a summary of the change and be sure you follow the contributions rules we do provide [here](./CONTRIBUTIONS.md)
Please include a summary of the change and be sure you follow the contributions rules we do provide [here](../CONTRIBUTIONS.md)

Task ID: [OS-?](https://aragonassociation.atlassian.net/browse/OS-?)

Expand All @@ -25,3 +25,4 @@ See the framework lifecylce in `packages/contracts/docs/framework-lifecycle` to
- [ ] I have updated the `CHANGELOG.md` file in the root folder.
- [ ] I have updated the `DEPLOYMENT_CHECKLIST` file in the root folder.
- [ ] I have updated the `UPDATE_CHECKLIST` file in the root folder.
- [ ] I have updated the Subgraph and added a QA URL to the description of this PR.
2 changes: 2 additions & 0 deletions .github/workflows/contract-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
defaults:
run:
working-directory: ${{env.working-directory}}
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/documentation-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
update_docs:
permissions: read-all
runs-on: ubuntu-latest
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/subgraph-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
run: yarn
- name: Build contracts
run: yarn run build:contracts
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
- name: Build manifest
run: yarn run manifest
env:
Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ If the answer to either of those two questions are "yes", then you're probably d
[ ] My changes generate no new warnings.
[ ] Any dependent changes have been merged and published in downstream modules.
[ ] I ran all tests with success and extended them if necessary.
[ ] I have updated the CHANGELOG.md file in the root folder of the package after the [UPCOMING] title and before the latest version.
[ ] I have tested my code on the test network.
[ ] I have updated the `CHANGELOG.md` file in the root folder.
[ ] I have updated the `DEPLOYMENT_CHECKLIST` file in the root folder.
[ ] I have updated the `UPDATE_CHECKLIST` file in the root folder.
[ ] I have updated the Subgraph and added a QA URL to the description of this PR.
```

6. Wait for the pull request to be reviewed by the team.
Expand Down
3 changes: 3 additions & 0 deletions packages/contracts/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ HARDHAT_MANAGEMENT_DAO_MULTISIG=0xe3ADd897e69010709498738e5116C06B4D81e672 # Cha

# not using this variable will disable the feature. Anything else will enable it
TEST_UPDATE_DEPLOY_SCRIPT=

## Alchemy RPC endpoint credentials
ALCHEMY_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
4 changes: 3 additions & 1 deletion packages/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ yarn add @aragon/osx-artifacts

## Get Started

To get started running your repository locally:
Before starting make sure that you have created an `.env` file from the `.env.example` file and filled in the Alchemy API key. Feel free to add other API keys for the services that you want to use.

Now you can get started running your repository locally:

1. Install packages from the root folder with `yarn`
2. Change directory into this package (`/pacakages/contracts`)
Expand Down
32 changes: 22 additions & 10 deletions packages/contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import networks, {ContractsNetworkConfig} from './networks';
import {networkExtensions} from './networks';
import {AragonPluginRepos, TestingFork} from './types/hardhat';
import {NetworkConfigs} from '@aragon/osx-commons-configs';
import {SupportedNetworks} from '@aragon/osx-commons-configs';
import {
networks as commonNetworkConfigs,
SupportedNetworks,
addRpcUrlToNetwork,
} from '@aragon/osx-commons-configs';
import '@nomicfoundation/hardhat-chai-matchers';
import '@nomicfoundation/hardhat-network-helpers';
import '@nomicfoundation/hardhat-verify';
Expand All @@ -10,22 +13,31 @@ import * as dotenv from 'dotenv';
import 'hardhat-deploy';
import 'hardhat-gas-reporter';
import {extendEnvironment, HardhatUserConfig} from 'hardhat/config';
import type {NetworkUserConfig} from 'hardhat/types';
import 'solidity-coverage';
import 'solidity-docgen';

type HardhatNetworksExtension = ContractsNetworkConfig & {
accounts?: string[];
};

dotenv.config();

const ETH_KEY = process.env.ETH_KEY;
const accounts = ETH_KEY ? ETH_KEY.split(',') : [];

// check alchemy Api key existence
if (process.env.ALCHEMY_API_KEY) {
addRpcUrlToNetwork(process.env.ALCHEMY_API_KEY);
} else {
throw new Error('ALCHEMY_API_KEY in .env not set');
}

// add accounts to network configs
const hardhatNetworks: NetworkConfigs<HardhatNetworksExtension> = networks;
for (const network of Object.keys(networks)) {
hardhatNetworks[network as SupportedNetworks].accounts = accounts;
const hardhatNetworks: {[index: string]: NetworkUserConfig} =
commonNetworkConfigs;
for (const network of Object.keys(hardhatNetworks) as SupportedNetworks[]) {
if (network === SupportedNetworks.LOCAL) {
continue;
}
hardhatNetworks[network].accounts = accounts;
hardhatNetworks[network].deploy = networkExtensions[network].deploy;
}

// Extend HardhatRuntimeEnvironment
Expand Down
72 changes: 0 additions & 72 deletions packages/contracts/networks.json

This file was deleted.

18 changes: 2 additions & 16 deletions packages/contracts/networks.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,36 @@
import {NetworkConfigs, networks} from '@aragon/osx-commons-configs';

export type ContractsNetworkConfig = {
type NetworkExtension = {
deploy: string[];
};

const networkExtensions: NetworkConfigs<ContractsNetworkConfig> = {
export const networkExtensions: {[index: string]: NetworkExtension} = {
mainnet: {
...networks.mainnet,
deploy: ['./deploy/update/to_v1.3.0', './deploy/verification'],
},
goerli: {
...networks.goerli,
deploy: ['./deploy/update/to_v1.3.0', './deploy/verification'],
},
sepolia: {
...networks.sepolia,
deploy: ['./deploy/new', './deploy/verification'],
},
polygon: {
...networks.polygon,
deploy: ['./deploy/update/to_v1.3.0', './deploy/verification'],
},
mumbai: {
...networks.mumbai,
deploy: ['./deploy/update/to_v1.3.0', './deploy/verification'],
},
baseMainnet: {
...networks.baseMainnet,
deploy: ['./deploy/new', './deploy/verification'],
},
baseGoerli: {
...networks.baseGoerli,
deploy: ['./deploy/new', './deploy/verification'],
},
arbitrum: {
...networks.arbitrum,
deploy: ['./deploy/new', './deploy/verification'],
},
baseSepolia: {
...networks.baseSepolia,
deploy: ['./deploy/new', './deploy/verification'],
},
arbitrumSepolia: {
...networks.arbitrumSepolia,
deploy: ['./deploy/new', './deploy/verification'],
},
};

export default networkExtensions;
2 changes: 1 addition & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@openzeppelin/contracts-upgradeable": "4.9.5"
},
"devDependencies": {
"@aragon/osx-commons-configs": "^0.1.0",
"@aragon/osx-commons-configs": "^0.4.0",
"@aragon/osx-commons-sdk": "0.0.1-alpha.3",
"@aragon/osx-ethers-v1.2.0": "npm:@aragon/[email protected]",
"@aragon/osx-v1.0.1": "npm:@aragon/[email protected]",
Expand Down
2 changes: 2 additions & 0 deletions packages/subgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UPCOMING]

## 1.4.1

## 1.5.0

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/subgraph/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aragon/osx-subgraph",
"version": "1.4.0",
"version": "1.4.1",
"description": "The Aragon OSx Subgraph",
"homepage": "https://github.com/aragon/osx",
"license": "AGPL-3.0-or-later",
Expand Down
Loading

0 comments on commit 9f5f974

Please sign in to comment.