Skip to content

Commit

Permalink
Feature: Add support for arbitrum (#296)
Browse files Browse the repository at this point in the history
* add support for arbitrum

* add support for arbitrum
  • Loading branch information
josemarinas committed Oct 31, 2023
1 parent 0365e00 commit ee45d0e
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 8 deletions.
6 changes: 6 additions & 0 deletions modules/client-common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ TEMPLATE:
-->

## [UPCOMING]
### Added

- Add support for arbitrum network


## [1.9.0]

### Changed

Expand Down
4 changes: 2 additions & 2 deletions modules/client-common/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aragon/sdk-client-common",
"author": "Aragon Association",
"version": "1.9.0",
"version": "1.10.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/sdk-client-common.esm.js",
Expand Down Expand Up @@ -58,7 +58,7 @@
},
"dependencies": {
"@aragon/osx-ethers-v1.0.0": "npm:@aragon/osx-ethers@1.2.1",
"@aragon/osx-ethers": "^1.3.0-rc0.3",
"@aragon/osx-ethers": "^1.3.0-rc0.4",
"@aragon/sdk-ipfs": "^1.1.0",
"@ethersproject/abstract-signer": "^5.5.0",
"@ethersproject/bignumber": "^5.6.0",
Expand Down
84 changes: 83 additions & 1 deletion modules/client-common/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ type GraphqlNetworks =
| "baseGoerli"
| "baseMainnet"
| "local"
| "sepolia";
| "sepolia"
| "arbitrum-one"
| "arbitrum-goerli";

const SupportedNetworksToGraphqlNetworks: {
[K in SupportedNetwork]: GraphqlNetworks;
Expand All @@ -31,6 +33,8 @@ const SupportedNetworksToGraphqlNetworks: {
[SupportedNetwork.BASE]: "baseMainnet",
[SupportedNetwork.LOCAL]: "local",
[SupportedNetwork.SEPOLIA]: "sepolia",
[SupportedNetwork.ARBITRUM]: "arbitrum-one",
[SupportedNetwork.ARBITRUM_GOERLI]: "arbitrum-goerli",
};

export const UNSUPPORTED_PROPOSAL_METADATA_LINK: ProposalMetadata = {
Expand Down Expand Up @@ -75,6 +79,12 @@ export const GRAPHQL_NODES: { [K in SupportedNetwork]: { url: string }[] } = {
[SupportedNetwork.SEPOLIA]: [{
url: getGraphqlNode(SupportedNetwork.SEPOLIA),
}],
[SupportedNetwork.ARBITRUM]: [{
url: getGraphqlNode(SupportedNetwork.ARBITRUM),
}],
[SupportedNetwork.ARBITRUM_GOERLI]: [{
url: getGraphqlNode(SupportedNetwork.ARBITRUM_GOERLI),
}],
};

const IPFS_ENDPOINTS = {
Expand Down Expand Up @@ -110,6 +120,8 @@ export const IPFS_NODES: {
[SupportedNetwork.BASE_GOERLI]: IPFS_ENDPOINTS.test,
[SupportedNetwork.LOCAL]: IPFS_ENDPOINTS.test,
[SupportedNetwork.SEPOLIA]: IPFS_ENDPOINTS.test,
[SupportedNetwork.ARBITRUM]: IPFS_ENDPOINTS.prod,
[SupportedNetwork.ARBITRUM_GOERLI]: IPFS_ENDPOINTS.test,
};

export const LIVE_CONTRACTS: {
Expand Down Expand Up @@ -238,6 +250,32 @@ export const LIVE_CONTRACTS: {
tokenVotingSetupAddress: "",
ensRegistryAddress: "",
},
[SupportedNetwork.ARBITRUM]: {
daoFactoryAddress: "",
pluginSetupProcessorAddress: "",
multisigRepoAddress: "",
adminRepoAddress: "",
addresslistVotingRepoAddress: "",
tokenVotingRepoAddress: "",
multisigSetupAddress: "",
adminSetupAddress: "",
addresslistVotingSetupAddress: "",
tokenVotingSetupAddress: "",
ensRegistryAddress: "",
},
[SupportedNetwork.ARBITRUM_GOERLI]: {
daoFactoryAddress: "",
pluginSetupProcessorAddress: "",
multisigRepoAddress: "",
adminRepoAddress: "",
addresslistVotingRepoAddress: "",
tokenVotingRepoAddress: "",
multisigSetupAddress: "",
adminSetupAddress: "",
addresslistVotingSetupAddress: "",
tokenVotingSetupAddress: "",
ensRegistryAddress: "",
},
},
[SupportedVersion.V1_3_0]: {
[SupportedNetwork.MAINNET]: {
Expand Down Expand Up @@ -365,6 +403,38 @@ export const LIVE_CONTRACTS: {
tokenVotingSetupAddress: activeContractsList.sepolia.TokenVotingSetup,
ensRegistryAddress: activeContractsList.sepolia.ENSRegistry,
},
[SupportedNetwork.ARBITRUM]: {
daoFactoryAddress: activeContractsList.arbitrum.DAOFactory,
pluginSetupProcessorAddress:
activeContractsList.arbitrum.PluginSetupProcessor,
multisigRepoAddress: activeContractsList.arbitrum["multisig-repo"],
adminRepoAddress: activeContractsList.arbitrum["admin-repo"],
addresslistVotingRepoAddress:
activeContractsList.arbitrum["address-list-voting-repo"],
tokenVotingRepoAddress: activeContractsList.arbitrum["token-voting-repo"],
multisigSetupAddress: activeContractsList.arbitrum.MultisigSetup,
adminSetupAddress: activeContractsList.arbitrum.AdminSetup,
addresslistVotingSetupAddress:
activeContractsList.arbitrum.AddresslistVotingSetup,
tokenVotingSetupAddress: activeContractsList.arbitrum.TokenVotingSetup,
ensRegistryAddress: activeContractsList.arbitrum.ENSRegistry,
},
[SupportedNetwork.ARBITRUM_GOERLI]: {
daoFactoryAddress: activeContractsList.arbitrumGoerli.DAOFactory,
pluginSetupProcessorAddress:
activeContractsList.arbitrumGoerli.PluginSetupProcessor,
multisigRepoAddress: activeContractsList.arbitrumGoerli["multisig-repo"],
adminRepoAddress: activeContractsList.arbitrumGoerli["admin-repo"],
addresslistVotingRepoAddress:
activeContractsList.arbitrumGoerli["address-list-voting-repo"],
tokenVotingRepoAddress: activeContractsList.arbitrumGoerli["token-voting-repo"],
multisigSetupAddress: activeContractsList.arbitrumGoerli.MultisigSetup,
adminSetupAddress: activeContractsList.arbitrumGoerli.AdminSetup,
addresslistVotingSetupAddress:
activeContractsList.arbitrumGoerli.AddresslistVotingSetup,
tokenVotingSetupAddress: activeContractsList.arbitrumGoerli.TokenVotingSetup,
ensRegistryAddress: activeContractsList.arbitrumGoerli.ENSRegistry,
},
},
};
export const ADDITIONAL_NETWORKS: Network[] = [
Expand All @@ -376,6 +446,18 @@ export const ADDITIONAL_NETWORKS: Network[] = [
name: "base",
chainId: 8453,
},
{
name: "arbitrum",
chainId: 42161,
},
{
name: "arbitrumGoerli",
chainId: 421613,
},
{
name: "sepolia",
chainId: 58008,
},
{
name: "local",
chainId: 31337,
Expand Down
2 changes: 2 additions & 0 deletions modules/client-common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export enum SupportedNetwork {
BASE_GOERLI = "baseGoerli",
LOCAL = "local",
SEPOLIA = "sepolia",
ARBITRUM = "arbitrum",
ARBITRUM_GOERLI = "arbitrumGoerli",
}

export const SupportedNetworksArray = Object.values(SupportedNetwork);
Expand Down
4 changes: 4 additions & 0 deletions modules/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ TEMPLATE:
-->

## [UPCOMING]
### Added

- Support for arbitrum network

## [1.18.0]
### Fixed

- Fix support for subgraph 1.3.1
Expand Down
6 changes: 3 additions & 3 deletions modules/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aragon/sdk-client",
"author": "Aragon Association",
"version": "1.17.1",
"version": "1.18.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/sdk-client.esm.js",
Expand Down Expand Up @@ -61,8 +61,8 @@
"typescript": "^4.6.2"
},
"dependencies": {
"@aragon/osx-ethers": "1.3.0-rc0.3",
"@aragon/sdk-client-common": "^1.9.0",
"@aragon/osx-ethers": "1.3.0-rc0.4",
"@aragon/sdk-client-common": "^1.10.0",
"@aragon/sdk-ipfs": "^1.1.0",
"@ethersproject/abstract-signer": "^5.5.0",
"@ethersproject/bignumber": "^5.6.0",
Expand Down
4 changes: 2 additions & 2 deletions modules/client/src/internal/graphql-queries/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ query IPlugin($address: ID!, $where: IPlugin_filter!) {
`;

export const QueryPluginPreparations = gql`
query PluginPreparations($where: PluginUpdatePreparation_filter!) {
query PluginPreparations($where: PluginPreparation_filter!) {
pluginPreparations(where: $where){
data
}
}
`;

export const QueryPluginPreparationsExtended = gql`
query PluginPreparations($where: PluginUpdatePreparation_filter!, limit: Int!, skip: Int!, direction: OrderDirection!, sortBy: PluginUpdatePreparation_orderBy!) {
query PluginPreparations($where: PluginPreparation_filter!, $limit: Int!, $skip: Int!, $direction: OrderDirection!, $sortBy: PluginPreparation_orderBy!) {
pluginPreparations(where: $where, first: $limit, skip: $skip, orderDirection: $direction, orderBy: $sortBy){
id
type
Expand Down

0 comments on commit ee45d0e

Please sign in to comment.