Skip to content

Commit

Permalink
fix: add info about payloads to the developers docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Jan 13, 2025
1 parent 32eeca9 commit 5dba84f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 27 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ We have our own hosted version from Vercel, you can access it on [https://vote.o

### 2. How to add new payloads controller support to the application?

2.1. First need to determine whether this will be added to a new chain or whether a new controller will be added to one of the existing chain.

2.2. Need to update `@bgd-labs/aave-address-book`.

2.3. If the controller is added to an existing chain:

2.3.1. Need to find the required chain in the application payload controller configuration. [file](./src/configs/appConfigInit.ts)

2.3.2. Need to leave the address of the payload controller from the address-book first, and insert the old address that was used earlier as the second element of the array. We leave the old address of the payload controller so that it would be possible to view the data on the payloads from the old controller in the UI. `TIP: Old payloads controller addresses will be added here in the array`

2.3. If the controller is added to a new chain:

2.3.1. Need to add support for the new chain to the application if it is not already done. How to add support for the new chain is described in the first point.

2.3.2. Need to add the address of the payloads controller and the payloads controller data helper to the application payload controller configuration. [file](./src/configs/appConfigInit.ts) `TIP: Addresses for the new chain with a payload controller are added here`

## License

Copyright © 2023, Aave DAO, represented by its governance smart contracts.
Expand Down
48 changes: 25 additions & 23 deletions src/configs/appConfigInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const payloadsControllerConfig: Record<
mainnet: {
[mainnet.id]: {
dataHelperContractAddress: GovernanceV3Ethereum.PC_DATA_HELPER,
contractAddresses: [GovernanceV3Ethereum.PAYLOADS_CONTROLLER],
contractAddresses: [GovernanceV3Ethereum.PAYLOADS_CONTROLLER], // TIP: Old payloads controller addresses will be added here in the array, after the address from the address-book, and so on for each network.
},
[polygon.id]: {
dataHelperContractAddress: GovernanceV3Polygon.PC_DATA_HELPER,
Expand Down Expand Up @@ -116,6 +116,12 @@ export const payloadsControllerConfig: Record<
dataHelperContractAddress: GovernanceV3ZkSync.PC_DATA_HELPER,
contractAddresses: [GovernanceV3ZkSync.PAYLOADS_CONTROLLER],
},
// TIP: Addresses for the new chain with a payload controller are added here
// example:
// [newChain.id]: {
// dataHelperContractAddress: AddressBook.PC_DATA_HELPER,
// contractAddresses: [AddressBook.PAYLOADS_CONTROLLER],
// },
},
// testnets
sepolia: {
Expand All @@ -132,6 +138,15 @@ export const payloadsControllerConfig: Record<
},
};

export const payloadsControllerChainIds: Record<CoreNetworkName, number[]> = {
mainnet: Object.keys(payloadsControllerConfig['mainnet']).map((key) =>
Number(key),
),
sepolia: Object.keys(payloadsControllerConfig['sepolia']).map((key) =>
Number(key),
),
};

const votingMachineConfig: Record<
CoreNetworkName,
Record<number, Config & { dataWarehouseAddress: Hex }>
Expand Down Expand Up @@ -168,6 +183,15 @@ const votingMachineConfig: Record<
},
};

export const votingMachineChainIds: Record<CoreNetworkName, number[]> = {
mainnet: Object.keys(votingMachineConfig['mainnet']).map((key) =>
Number(key),
),
sepolia: Object.keys(votingMachineConfig['sepolia']).map((key) =>
Number(key),
),
};

const govCoreChainId: Record<CoreNetworkName, number> = {
mainnet: mainnet.id,
// testnets
Expand All @@ -191,28 +215,6 @@ const aditionalsAddresses: Record<CoreNetworkName, Record<string, Hex>> = {
},
};

export const payloadsControllerChainIds: Record<CoreNetworkName, number[]> = {
mainnet: [
mainnet.id,
polygon.id,
avalanche.id,
base.id,
arbitrum.id,
metis.id,
optimism.id,
bsc.id,
gnosis.id,
scroll.id,
zkSync.id,
],
sepolia: [sepolia.id, avalancheFuji.id],
};

export const votingMachineChainIds: Record<CoreNetworkName, number[]> = {
mainnet: [mainnet.id, polygon.id, avalanche.id],
sepolia: [sepolia.id, avalancheFuji.id],
};

export const appConfigInit = (coreNetwork: CoreNetworkName) => {
return {
govCoreChainId: govCoreChainId[coreNetwork],
Expand Down
8 changes: 4 additions & 4 deletions src/configs/configs.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// ipfs gateway to get proposals metadata
export const ipfsGateway = 'https://dweb.link/ipfs';

// proposals list page size
// page size for paginated data
export const PAGE_SIZE = 12;

// for balance formatting
// decimals count for balance formatting
export const DECIMALS = 18;

// for API Requests
// endpoint for API Requests
export const INITIAL_API_URL = `https://api.onaave.com/gov`;

// for data polling time
// data polling time for all polling on the UI
export const DATA_POLLING_TIME = 60_000;

1 comment on commit 5dba84f

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.