From 3e350182c91b1e650dc7588376976ded0a67a2d4 Mon Sep 17 00:00:00 2001 From: Chris Maniewski Date: Wed, 23 Oct 2024 16:42:37 +0200 Subject: [PATCH] feat!: make Arbitrum One the default chain --- .changeset/brave-impalas-flow.md | 9 +++++++++ packages/colony-js/README.md | 8 ++++---- .../colony-js/docs/api/enums/ColonyRpcEndpoint.md | 4 ++-- .../docs/api/enums/MetaTxBroadCasterEndpoint.md | 2 +- .../docs/api/enums/ReputationOracleEndpoint.md | 2 +- packages/colony-js/docs/getting-started.md | 6 +++--- packages/colony-js/src/__tests__/integration.ts | 6 +++--- packages/core/src/constants.ts | 8 ++++---- packages/core/src/helpers/reputation.ts | 2 +- packages/events/README.md | 4 ++-- packages/sdk/README.md | 4 ++-- packages/sdk/docs/api/classes/Colony.md | 2 +- packages/sdk/docs/api/classes/ColonyNetwork.md | 10 +++++----- packages/sdk/docs/api/classes/OneTxPayment.md | 4 ++-- packages/sdk/docs/api/enums/ColonyRpcEndpoint.md | 4 ++-- packages/sdk/docs/getting-started/index.md | 10 +++++----- packages/sdk/docs/guides/colony-creation.md | 9 +++++---- packages/sdk/examples/browser/src/basic.ts | 6 +++--- packages/sdk/examples/browser/src/events.ts | 2 +- packages/sdk/examples/browser/src/index.ts | 12 ++++++------ packages/sdk/examples/browser/web/index.html | 2 +- packages/sdk/examples/node/automation.ts | 5 +++-- packages/sdk/examples/node/basic.ts | 2 +- packages/sdk/examples/node/create.ts | 2 +- packages/sdk/examples/node/metatx.ts | 2 +- packages/sdk/examples/node/roles.ts | 4 ++-- packages/sdk/src/ColonyNetwork/Colony.ts | 2 +- packages/sdk/src/ColonyNetwork/ColonyNetwork.ts | 12 ++++++------ packages/sdk/src/ColonyNetwork/OneTxPayment.ts | 4 ++-- packages/tokens/README.md | 4 ++-- 30 files changed, 82 insertions(+), 71 deletions(-) create mode 100644 .changeset/brave-impalas-flow.md diff --git a/.changeset/brave-impalas-flow.md b/.changeset/brave-impalas-flow.md new file mode 100644 index 000000000..31f32d58e --- /dev/null +++ b/.changeset/brave-impalas-flow.md @@ -0,0 +1,9 @@ +--- +"@colony/colony-js": major +"@colony/events": major +"@colony/tokens": major +"@colony/core": major +"@colony/sdk": major +--- + +Make Arbitrum One the default network in all cases. While this can be considered a breaking change it does not change any of the APIs. diff --git a/packages/colony-js/README.md b/packages/colony-js/README.md index 03ff870d0..48dea7648 100644 --- a/packages/colony-js/README.md +++ b/packages/colony-js/README.md @@ -22,7 +22,7 @@ import { getColonyNetworkClient, ColonRpcEndpoint, Id, Network, Tokens } from '@ const { formatEther } = utils; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); const start = async () => { // Get a wallet instance @@ -35,16 +35,16 @@ const start = async () => { // Check out the logs to see the wallet address console.log('Wallet Address:', wallet.address); - // Get a network client instance for Gnosis Chain + // Get a network client instance for ArbitrumOne Chain const networkClient = getColonyNetworkClient( - Network.Gnosis, + Network.ArbitrumOne, wallet, ); // Let's connect to the Meta Colony const metaColonyClient = await networkClient.getMetaColonyClient() // And check out it's CLNY funding - const funding = await metaColonyClient.getFundingPotBalance(Id.RootPot, Tokens.Gnosis.CLNY); + const funding = await metaColonyClient.getFundingPotBalance(Id.RootPot, Tokens.ArbitrumOne.CLNY); // We can also see its address const { address } = metaColonyClient; console.info(`${formatEther(funding)} CLNY in root domain of MetaColony with address: ${address}`); diff --git a/packages/colony-js/docs/api/enums/ColonyRpcEndpoint.md b/packages/colony-js/docs/api/enums/ColonyRpcEndpoint.md index 8b486a761..e9b13eae4 100644 --- a/packages/colony-js/docs/api/enums/ColonyRpcEndpoint.md +++ b/packages/colony-js/docs/api/enums/ColonyRpcEndpoint.md @@ -6,7 +6,7 @@ Official Colony RPC2 endpoint (node) ### ArbitrumOne -• **ArbitrumOne** = ``"https://arbitrum.colony.io/publicrpc/"`` +• **ArbitrumOne** = ``"https://app.colony.io/public-rpc/"`` Colony's own RPC2 endpoint for Arbitrum One @@ -14,7 +14,7 @@ ___ ### ArbitrumSepolia -• **ArbitrumSepolia** = ``"https://arbitrum-sepolia.colony.io/publicrpc/"`` +• **ArbitrumSepolia** = ``"https://arbitrum-sepolia.colony.io/public-rpc/"`` Colony's own RPC2 endpoint for Arbitrum Sepolia testnet diff --git a/packages/colony-js/docs/api/enums/MetaTxBroadCasterEndpoint.md b/packages/colony-js/docs/api/enums/MetaTxBroadCasterEndpoint.md index d9007b425..01c8b1b84 100644 --- a/packages/colony-js/docs/api/enums/MetaTxBroadCasterEndpoint.md +++ b/packages/colony-js/docs/api/enums/MetaTxBroadCasterEndpoint.md @@ -6,7 +6,7 @@ HTTP endpoint of the official Colony MetaTransaction (gasless transaction) broad ### ArbitrumOne -• **ArbitrumOne** = ``"https://arbitrum.colony.io/metatransaction/arbitrum-one"`` +• **ArbitrumOne** = ``"https://app.colony.io/metatransaction/arbitrum-one"`` The metatransaction broadcaster endpoint on Arbitrum One diff --git a/packages/colony-js/docs/api/enums/ReputationOracleEndpoint.md b/packages/colony-js/docs/api/enums/ReputationOracleEndpoint.md index cd8fcfecc..1c838d13b 100644 --- a/packages/colony-js/docs/api/enums/ReputationOracleEndpoint.md +++ b/packages/colony-js/docs/api/enums/ReputationOracleEndpoint.md @@ -6,7 +6,7 @@ HTTP endpoint of the official Colony reputation oracle ### ArbitrumOne -• **ArbitrumOne** = ``"https://arbitrum.colony.io/reputation/arbitrum-one"`` +• **ArbitrumOne** = ``"https://app.colony.io/reputation/arbitrum-one"`` ___ diff --git a/packages/colony-js/docs/getting-started.md b/packages/colony-js/docs/getting-started.md index b091583cf..7325f9aaa 100644 --- a/packages/colony-js/docs/getting-started.md +++ b/packages/colony-js/docs/getting-started.md @@ -24,16 +24,16 @@ const start = async () => { // Check out the logs to see the wallet address console.log('Wallet Address:', wallet.address); - // Get a network client instance for Gnosis Chain + // Get a network client instance for Arbitrum One const networkClient = await getColonyNetworkClient( - Network.Gnosis, + Network.ArbitrumOne, wallet, ); // Let's connect to the Meta Colony const metaColonyClient = await networkClient.getMetaColonyClient() // And check out it's CLNY funding - const funding = await metaColonyClient.getFundingPotBalance(Id.RootPot, Tokens.Gnosis.CLNY); + const funding = await metaColonyClient.getFundingPotBalance(Id.RootPot, Tokens.ArbitrumOne.CLNY); // We can also see its address const { address } = metaColonyClient; console.info(`${formatEther(funding)} CLNY in root domain of MetaColony with address: ${address}`); diff --git a/packages/colony-js/src/__tests__/integration.ts b/packages/colony-js/src/__tests__/integration.ts index 3a0867949..a74d057c6 100644 --- a/packages/colony-js/src/__tests__/integration.ts +++ b/packages/colony-js/src/__tests__/integration.ts @@ -9,18 +9,18 @@ import getColonyNetworkClient from '../clients/ColonyNetworkClient.js'; let provider: JsonRpcProvider; beforeAll(async () => { - provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); + provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); }); describe('ColonyNetwork', () => { it('Can get the colony network', async () => { const colonyNetworkClient = getColonyNetworkClient( - Network.Gnosis, + Network.ArbitrumOne, provider, ); const metaColonyAddress = await colonyNetworkClient.getMetaColony(); expect(metaColonyAddress).toEqual( - '0xCFD3aa1EbC6119D80Ed47955a87A9d9C281A97B3', + '0xa405A3353Bc7d6048C64BC3663f665A01fF3f43f', ); }); }); diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 89f789f86..9954da331 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -68,7 +68,7 @@ export enum ReputationOracleEndpoint { Xdai = 'https://xdai.colony.io/reputation/xdai', XdaiQa = 'https://qa-xdai.colony.io/reputation/xdai', Custom = 'http://localhost:3000', - ArbitrumOne = 'https://arbitrum.colony.io/reputation/arbitrum-one', + ArbitrumOne = 'https://app.colony.io/reputation/arbitrum-one', ArbitrumSepolia = `https://arbitrum-sepolia.colony.io/reputation/arbitrum-sepolia`, } @@ -89,7 +89,7 @@ export enum MetaTxBroadCasterEndpoint { /** The metatransaction broadcaster endpoint for a custom network */ Custom = '', /** The metatransaction broadcaster endpoint on Arbitrum One */ - ArbitrumOne = 'https://arbitrum.colony.io/metatransaction/arbitrum-one', + ArbitrumOne = 'https://app.colony.io/metatransaction/arbitrum-one', /** The metatransaction broadcaster endpoint on Arbitrum Sepolia testnet */ ArbitrumSepolia = `https://arbitrum-sepolia.colony.io/metatransaction/arbitrum-sepolia`, } @@ -111,9 +111,9 @@ export enum ColonyRpcEndpoint { /** Colony's own RPC2 endpoint for a custom network */ Custom = '', /** Colony's own RPC2 endpoint for Arbitrum One */ - ArbitrumOne = 'https://arbitrum.colony.io/publicrpc/', + ArbitrumOne = 'https://app.colony.io/public-rpc/', /** Colony's own RPC2 endpoint for Arbitrum Sepolia testnet */ - ArbitrumSepolia = 'https://arbitrum-sepolia.colony.io/publicrpc/', + ArbitrumSepolia = 'https://arbitrum-sepolia.colony.io/public-rpc/', } /** diff --git a/packages/core/src/helpers/reputation.ts b/packages/core/src/helpers/reputation.ts index ac3308be0..aa49fffd8 100644 --- a/packages/core/src/helpers/reputation.ts +++ b/packages/core/src/helpers/reputation.ts @@ -55,7 +55,7 @@ export class ReputationClient { this.colony = colony; this.network = network; - const networkName = config?.network || Network.Gnosis; + const networkName = config?.network || Network.ArbitrumOne; this.endpointUrl = config?.customEndpointUrl || ReputationOracleEndpoint[networkName]; } diff --git a/packages/events/README.md b/packages/events/README.md index 2982c1f79..a2cbd5d52 100644 --- a/packages/events/README.md +++ b/packages/events/README.md @@ -4,7 +4,7 @@ # `@colony/events` -This package contains pre-compiled Colony event contract bindings. These bindings contain types and ABIs for all events for all contracts across all versions in the Colony Network. You could use them in conjunction with the [EventManger from Colony SDK](https://docs.colony.io/colonysdk/api/classes/ColonyEventManager): +This package contains pre-compiled Colony event contract bindings. These bindings contain types and ABIs for all events for all contracts across all versions in the Colony Network. You could use them in conjunction with the [EventManager from Colony SDK](https://docs.colony.io/colonysdk/api/classes/ColonyEventManager): ```ts import { providers } from 'ethers'; @@ -17,7 +17,7 @@ import { MetadataType, } from '@colony/sdk'; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); const manager = new ColonyEventManager(provider); const colonyEventSource = manager.createEventSource(ColonyEventsFactory); diff --git a/packages/sdk/README.md b/packages/sdk/README.md index 3621a872a..ae0a5b8b8 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -20,7 +20,7 @@ import { providers } from 'ethers'; import { ColonyNetwork, toEth } from '@colony/sdk'; // If MetaMask is installed there will be an `ethereum` object on the `window` -// NOTE: Make sure MetaMask is connected to Gnosis chain (see https://www.xdaichain.com/for-users/wallets/metamask/metamask-setup) +// NOTE: Make sure MetaMask is connected to ArbitrumOne chain (use https://app.colony.io/public-rpc or see https://chainlist.org/chain/42161) const provider = new providers.Web3Provider(window.ethereum); // Get the MetaColony's CLNY funding in the root team (id 1) @@ -81,7 +81,7 @@ pnpm run examples:browser ### Some notes -These examples will run on Gnosis chain. If you'd like to make transactions, you will need some XDAI. Reach out to us in our [Discord](https://discord.gg/feVZWwysqM) if you're having trouble starting out. +These examples will run on the Arbitrum One chain. If you'd like to make transactions, you will need some ETH on that chain. Reach out to us in our [Discord](https://discord.gg/feVZWwysqM) if you're having trouble starting out. ## Development diff --git a/packages/sdk/docs/api/classes/Colony.md b/packages/sdk/docs/api/classes/Colony.md index bd79f2efe..e4795ea67 100644 --- a/packages/sdk/docs/api/classes/Colony.md +++ b/packages/sdk/docs/api/classes/Colony.md @@ -582,7 +582,7 @@ Get the xDAI balance of the team number 2 ```typescript import { constants } from 'ethers'; import { toEth } from '@colony/sdk'; -// The `AddressZero` means ETH on mainnet and xDAI on Gnosis chain +// The `AddressZero` means ETH on most networks const balance = await colony.getBalance(constants.AddressZero, 2); // This will format the balance as a string in eth and not wei (i.e. 1.0 vs. 1000000000000000000) console.info(toEth(balance)); diff --git a/packages/sdk/docs/api/classes/ColonyNetwork.md b/packages/sdk/docs/api/classes/ColonyNetwork.md index cca5e9877..7c2d22982 100644 --- a/packages/sdk/docs/api/classes/ColonyNetwork.md +++ b/packages/sdk/docs/api/classes/ColonyNetwork.md @@ -17,8 +17,8 @@ From here you should be able to instantiate all the required instances for Colon import { providers } from 'ethers'; import { ColonyNetwork, ColonyRpcEndpoint, Tokens } from '@colony/sdk'; -// Connect directly to the deployed Colony Network on Gnosis Chain -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +// Connect directly to the deployed Colony Network on Arbitrum One +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); const colonyNetwork = new ColonyNetwork(provider); // Now you could call functions on the colonyNetwork, like `colonyNetwork.getMetaColony()` ``` @@ -44,7 +44,7 @@ ___ • **network**: [`Network`](../enums/Network.md) -The network the client is connected to. Defaults to Gnosis chain +The network the client is connected to. Defaults to Arbitrum One ___ @@ -90,7 +90,7 @@ import { Tokens } from '@colony/sdk'; // IPFS hash to an image file colonyAvatarHash: 'QmS26o1Cmsrx7iw1SSFGEcy22TVDq6VmEZ4XNjpWFyaKUe', // List of token addresses that the Colony should be initialized with (can be changed later) - excluding ETH and the native token from above - colonyTokens: [Tokens.Gnosis.CLNY], + colonyTokens: [Tokens.ArbitrumOne.CLNY], }).tx().mined(); })(); ``` @@ -149,7 +149,7 @@ See the [Colony Creation Guide](../../guides/colony-creation.md). // Create a colony // (forced transaction example) await colonyNetwork - // Use USDC on Gnosis chain as the native token + // Use USDC on Arbitrum One as the native token .createColony('0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83', 'coolony') .tx().mined(); })(); diff --git a/packages/sdk/docs/api/classes/OneTxPayment.md b/packages/sdk/docs/api/classes/OneTxPayment.md index 70af6257c..5514be1c9 100644 --- a/packages/sdk/docs/api/classes/OneTxPayment.md +++ b/packages/sdk/docs/api/classes/OneTxPayment.md @@ -61,13 +61,13 @@ import { Id, Tokens, w } from '@colony/sdk'; // Immediately executing async function (async function() { - // Pay 10 XDAI (on Gnosis chain) from the root domain to the following address + // Pay 10 CLNY (on ArbitrumOne chain) from the root domain to the following address // (forced transaction example) await colony.ext.oneTx.pay( '0xb77D57F4959eAfA0339424b83FcFaf9c15407461', w`10`, Id.RootDomain, - Tokens.Gnosis.XDAI, + Tokens.ArbitrumOne.CLNY, ).tx().mined(); })(); ``` diff --git a/packages/sdk/docs/api/enums/ColonyRpcEndpoint.md b/packages/sdk/docs/api/enums/ColonyRpcEndpoint.md index 8b486a761..e9b13eae4 100644 --- a/packages/sdk/docs/api/enums/ColonyRpcEndpoint.md +++ b/packages/sdk/docs/api/enums/ColonyRpcEndpoint.md @@ -6,7 +6,7 @@ Official Colony RPC2 endpoint (node) ### ArbitrumOne -• **ArbitrumOne** = ``"https://arbitrum.colony.io/publicrpc/"`` +• **ArbitrumOne** = ``"https://app.colony.io/public-rpc/"`` Colony's own RPC2 endpoint for Arbitrum One @@ -14,7 +14,7 @@ ___ ### ArbitrumSepolia -• **ArbitrumSepolia** = ``"https://arbitrum-sepolia.colony.io/publicrpc/"`` +• **ArbitrumSepolia** = ``"https://arbitrum-sepolia.colony.io/public-rpc/"`` Colony's own RPC2 endpoint for Arbitrum Sepolia testnet diff --git a/packages/sdk/docs/getting-started/index.md b/packages/sdk/docs/getting-started/index.md index d64702883..bc1f9dfa8 100644 --- a/packages/sdk/docs/getting-started/index.md +++ b/packages/sdk/docs/getting-started/index.md @@ -27,7 +27,7 @@ npm install ethers @colony/sdk You'll need `ethers` v5.x as a dependency in your project. -## Connecting to Colony on Gnosis Chain +## Connecting to Colony on ArbitrumOne Chain @@ -41,7 +41,7 @@ import { providers } from 'ethers'; import { ColonyNetwork, toEth } from '@colony/sdk'; // If MetaMask is installed there will be an `ethereum` object on the `window` -// NOTE: Make sure MetaMask is connected to Gnosis chain (see https://docs.gnosischain.com/tools/wallets/metamask) +// NOTE: Make sure MetaMask is connected to ArbitrumOne chain (use https://app.colony.io/public-rpc or see https://chainlist.org/chain/42161) const provider = new providers.Web3Provider(window.ethereum); // Get the Colony's XDAI funding in the ROOT pot (id 1) @@ -68,12 +68,12 @@ Include the resulting bundle in an HTML file and open it in you favorite browser ```javascript const { providers, Wallet } = require('ethers'); -const { ColonyNetwork } = require('@colony/sdk'); +const { ColonyNetwork, ColonyRpcEndpoint } = require('@colony/sdk'); -const provider = new providers.JsonRpcProvider('https://xdai.colony.io/rpc/'); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); const wallet = Wallet.createRandom().connect(provider); -// Get the Colony's XDAI funding in the ROOT pot (id 1) +// Get the Colony's CLNY funding in the ROOT pot (id 1) const start = async () => { // Create a new connection to the Colony Network contracts using the MetaMask "wallet" const colonyNetwork = new ColonyNetwork(wallet); diff --git a/packages/sdk/docs/guides/colony-creation.md b/packages/sdk/docs/guides/colony-creation.md index 9e5cadf5a..e02f69092 100644 --- a/packages/sdk/docs/guides/colony-creation.md +++ b/packages/sdk/docs/guides/colony-creation.md @@ -18,14 +18,14 @@ These examples assume that the user executing the transactions has funds in thei ## Step 1 - Deploying the Colony contract (and optionally its token) -The most important step. Here the actualy Colony contract will be deployed. This happens by executing a contract method on the `ColonyNetwork` (as opposed to a deploy-transaction): +The most important step. Here the actual Colony contract will be deployed. This happens by executing a contract method on the `ColonyNetwork` (as opposed to a deploy-transaction): ```typescript import { providers } from 'ethers'; import { ColonyNetwork, ColonyRpcEndpoint, Wallet } from '@colony/sdk'; // Prepare your provider and signer (wallet) -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); const wallet = Wallet.createRandom().connect(provider); // Instantiate Colony Network const colonyNetwork = new ColonyNetwork(wallet); @@ -41,9 +41,10 @@ One can specify the token name, its symbol and even its decimals (even though it You can also use an already existing token. For that, instead of passing in the token's details as the first argument, just use the token's address (it needs to be in the same chain your Colony is deployed in), like so: ```typescript -// Use USDC on Gnosis chain as the native token +import { Tokens } from '@colony/sdk'; +// Use USDC on ArbitrumOne chain as the native token const [{ colonyAddress }] = await colonyNetwork - .createColony('0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83', 'anothertestname') + .createColony(Tokens.ArbitrumOne.USDC, 'anothertestname') .tx().mined(); ``` diff --git a/packages/sdk/examples/browser/src/basic.ts b/packages/sdk/examples/browser/src/basic.ts index d6727930a..9ba9edd98 100644 --- a/packages/sdk/examples/browser/src/basic.ts +++ b/packages/sdk/examples/browser/src/basic.ts @@ -8,13 +8,13 @@ import { const { formatEther, isAddress } = utils; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); -// Get the Colony's CLNY funding in the root domain (on Gnosis chain) +// Get the Colony's CLNY funding in the root domain (on Arbitrum One) const getColonyFunding = async (colonyAddress: string) => { const colonyNetwork = new ColonyNetwork(provider); const colony = await colonyNetwork.getColony(colonyAddress); - const funding = await colony.getBalance(Tokens.Gnosis.CLNY); + const funding = await colony.getBalance(Tokens.ArbitrumOne.CLNY); return formatEther(funding); }; diff --git a/packages/sdk/examples/browser/src/events.ts b/packages/sdk/examples/browser/src/events.ts index 562a74b85..80960def3 100644 --- a/packages/sdk/examples/browser/src/events.ts +++ b/packages/sdk/examples/browser/src/events.ts @@ -8,7 +8,7 @@ import { } from '../../../src/index.js'; import type { ColonyEvent } from '../../../src/index.js'; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); const { isAddress } = utils; // This event listener will only list for the `DomainAdded` event in the Colony of the user's choice. Run this and then create a Team in that Colony, to see it being picked up here diff --git a/packages/sdk/examples/browser/src/index.ts b/packages/sdk/examples/browser/src/index.ts index a5d404ec9..b6e62da13 100644 --- a/packages/sdk/examples/browser/src/index.ts +++ b/packages/sdk/examples/browser/src/index.ts @@ -9,15 +9,15 @@ const addColonyRPC = () => { method: 'wallet_addEthereumChain', params: [ { - chainId: '0x64', - chainName: 'Gnosis Chain via Colony', + chainId: '0xa4b1', + chainName: 'Arbitrum One via Colony', nativeCurrency: { - name: 'xDAI', - symbol: 'XDAI', + name: 'Ether', + symbol: 'ETH', decimals: 18, }, - rpcUrls: [ColonyRpcEndpoint.Gnosis], - blockExplorerUrls: ['https://blockscout.com/xdai/mainnet'], + rpcUrls: [ColonyRpcEndpoint.ArbitrumOne], + blockExplorerUrls: ['https://arbiscan.io/'], }, ], }); diff --git a/packages/sdk/examples/browser/web/index.html b/packages/sdk/examples/browser/web/index.html index 9a698ca48..35580bfc6 100644 --- a/packages/sdk/examples/browser/web/index.html +++ b/packages/sdk/examples/browser/web/index.html @@ -12,7 +12,7 @@

Colony SDK browser demos

href="https://github.com/JoinColony/colonyStarter">colonyStarter for more information.

Check out the source code for the examples here.

-

These demos interact with LIVE Colonies on Gnosis chain. We recommend to use the Colony +

These demos interact with LIVE Colonies on ArbitrumOne chain. We recommend to use the Colony RPC endpoint directly.

  • diff --git a/packages/sdk/examples/node/automation.ts b/packages/sdk/examples/node/automation.ts index 4f9fbc92c..a812d50af 100644 --- a/packages/sdk/examples/node/automation.ts +++ b/packages/sdk/examples/node/automation.ts @@ -3,7 +3,7 @@ import 'cross-fetch/dist/node-polyfill.js'; import { ColonyNetwork, ColonyRpcEndpoint, w } from '../../src/index.js'; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); if (!process.env.PRIVATE_KEY) { throw new Error('Please provide PRIVATE_KEY as an environment variable'); @@ -19,7 +19,8 @@ const start = async () => { const colonyNetwork = new ColonyNetwork(wallet); // Get an instance of your favourite colony const colony = await colonyNetwork.getColony( - '0x364B3153A24bb9ECa28B8c7aCeB15E3942eb4fc5', + // https://app.colony.io/neverland + '0x9fBa8C85A1C7EEd48785A760E9399FcB6Fa5b04A', ); // Define recipients and amounts to pay out diff --git a/packages/sdk/examples/node/basic.ts b/packages/sdk/examples/node/basic.ts index 1d2a443de..4e1aedfee 100644 --- a/packages/sdk/examples/node/basic.ts +++ b/packages/sdk/examples/node/basic.ts @@ -3,7 +3,7 @@ import 'cross-fetch/dist/node-polyfill.js'; import { ColonyNetwork, ColonyRpcEndpoint, toEth } from '../../src/index.js'; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); // Get the Colony's CLNY funding in the ROOT team (id 1) const start = async () => { diff --git a/packages/sdk/examples/node/create.ts b/packages/sdk/examples/node/create.ts index 8a7ae6e61..3ed58aaec 100644 --- a/packages/sdk/examples/node/create.ts +++ b/packages/sdk/examples/node/create.ts @@ -9,7 +9,7 @@ import { SupportedExtension, } from '../../src/index.js'; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); if (!process.env.PRIVATE_KEY) { throw new Error( diff --git a/packages/sdk/examples/node/metatx.ts b/packages/sdk/examples/node/metatx.ts index 8f7a9ac43..462605349 100644 --- a/packages/sdk/examples/node/metatx.ts +++ b/packages/sdk/examples/node/metatx.ts @@ -3,7 +3,7 @@ import 'cross-fetch/dist/node-polyfill.js'; import { ColonyNetwork, ColonyRpcEndpoint } from '../../src/index.js'; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); // Claim ETH for the MetaColony using a Metatransaction const start = async () => { diff --git a/packages/sdk/examples/node/roles.ts b/packages/sdk/examples/node/roles.ts index ab2c970f0..e382a23aa 100644 --- a/packages/sdk/examples/node/roles.ts +++ b/packages/sdk/examples/node/roles.ts @@ -7,7 +7,7 @@ import { ColonyRpcEndpoint, } from '../../src/index.js'; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); if (!process.env.PRIVATE_KEY) { throw new Error( @@ -21,7 +21,7 @@ const signer = new Wallet(process.env.PRIVATE_KEY as string).connect(provider); const start = async () => { const colonyNetwork = new ColonyNetwork(signer); const colony = await colonyNetwork.getColony( - '0xA6fD5655c1249f1349D0917E732813Ebd9439A54', + '0x9fBa8C85A1C7EEd48785A760E9399FcB6Fa5b04A', ); await colony .setRoles('0xA75b108808584A15ceEbF8f6CAc19EaD91cAbCd2', [ diff --git a/packages/sdk/src/ColonyNetwork/Colony.ts b/packages/sdk/src/ColonyNetwork/Colony.ts index c4d1b013d..b9c8b3f5a 100644 --- a/packages/sdk/src/ColonyNetwork/Colony.ts +++ b/packages/sdk/src/ColonyNetwork/Colony.ts @@ -351,7 +351,7 @@ export class Colony { * ```typescript * import { constants } from 'ethers'; * import { toEth } from '@colony/sdk'; - * // The `AddressZero` means ETH on mainnet and xDAI on Gnosis chain + * // The `AddressZero` means ETH on most networks * const balance = await colony.getBalance(constants.AddressZero, 2); * // This will format the balance as a string in eth and not wei (i.e. 1.0 vs. 1000000000000000000) * console.info(toEth(balance)); diff --git a/packages/sdk/src/ColonyNetwork/ColonyNetwork.ts b/packages/sdk/src/ColonyNetwork/ColonyNetwork.ts index 62a585c14..bd5c8d267 100644 --- a/packages/sdk/src/ColonyNetwork/ColonyNetwork.ts +++ b/packages/sdk/src/ColonyNetwork/ColonyNetwork.ts @@ -86,7 +86,7 @@ export class ColonyNetwork { /** The IPFS adapter for Metadata. Defaults to a read-only adapter */ ipfs: IpfsMetadata; - /** The network the client is connected to. Defaults to Gnosis chain */ + /** The network the client is connected to. Defaults to Arbitrum One */ network: Network; /** @@ -108,8 +108,8 @@ export class ColonyNetwork { * import { providers } from 'ethers'; * import { ColonyNetwork, ColonyRpcEndpoint, Tokens } from '@colony/sdk'; * - * // Connect directly to the deployed Colony Network on Gnosis Chain - * const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); + * // Connect directly to the deployed Colony Network on Arbitrum One + * const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); * const colonyNetwork = new ColonyNetwork(provider); * // Now you could call functions on the colonyNetwork, like `colonyNetwork.getMetaColony()` * ``` @@ -122,7 +122,7 @@ export class ColonyNetwork { signerOrProvider: SignerOrProvider, options?: ColonyNetworkOptions, ) { - this.network = options?.network || Network.Gnosis; + this.network = options?.network || Network.ArbitrumOne; this.ipfs = new IpfsMetadata(options?.ipfsAdapter); // TODO: for validation: if network is Custom, metaTxBroadcaster and reputationOracleEndpoint have to be set this.config = { @@ -313,7 +313,7 @@ export class ColonyNetwork { * // IPFS hash to an image file * colonyAvatarHash: 'QmS26o1Cmsrx7iw1SSFGEcy22TVDq6VmEZ4XNjpWFyaKUe', * // List of token addresses that the Colony should be initialized with (can be changed later) - excluding ETH and the native token from above - * colonyTokens: [Tokens.Gnosis.CLNY], + * colonyTokens: [Tokens.ArbitrumOne.CLNY], * }).tx().mined(); * })(); * ``` @@ -377,7 +377,7 @@ export class ColonyNetwork { * // Create a colony * // (forced transaction example) * await colonyNetwork - * // Use USDC on Gnosis chain as the native token + * // Use USDC on Arbitrum One as the native token * .createColony('0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83', 'coolony') * .tx().mined(); * })(); diff --git a/packages/sdk/src/ColonyNetwork/OneTxPayment.ts b/packages/sdk/src/ColonyNetwork/OneTxPayment.ts index 40ad2c779..f2519dd24 100644 --- a/packages/sdk/src/ColonyNetwork/OneTxPayment.ts +++ b/packages/sdk/src/ColonyNetwork/OneTxPayment.ts @@ -179,13 +179,13 @@ export class OneTxPayment { * * // Immediately executing async function * (async function() { - * // Pay 10 XDAI (on Gnosis chain) from the root domain to the following address + * // Pay 10 CLNY (on ArbitrumOne chain) from the root domain to the following address * // (forced transaction example) * await colony.ext.oneTx.pay( * '0xb77D57F4959eAfA0339424b83FcFaf9c15407461', * w`10`, * Id.RootDomain, - * Tokens.Gnosis.XDAI, + * Tokens.ArbitrumOne.CLNY, * ).tx().mined(); * })(); * ``` diff --git a/packages/tokens/README.md b/packages/tokens/README.md index 48682cd65..53cc09ba9 100644 --- a/packages/tokens/README.md +++ b/packages/tokens/README.md @@ -11,12 +11,12 @@ import { providers } from 'ethers'; import { getTokenClient } from '@colony/tokens'; import { Tokens } from '@colony/core'; -const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); +const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.ArbitrumOne); // Immediately executing async function (async function() { // Pass in a Signer instead to do transactions - const token = await getTokenClient(Tokens.Gnosis.CLNY, provider); + const token = await getTokenClient(Tokens.ArbitrumOne.CLNY, provider); // Only tokens deployed with Colony have the `locked()` method const tokenIsLocked = await token.locked(); })();