Skip to content

Commit

Permalink
fix: finished developers doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Jan 15, 2025
1 parent ea0ca8c commit 6f6edfe
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,25 @@ We have our own hosted version from Vercel, you can access it on [https://vote.o

3.4.2. Follow the steps 3.3.1 and 3.3.2.

### 4. How to change gov core to testnet?
### 4. How to add support for a new voting asset?

4.1. Simply, need to change the core name to sepolia. [file](./src/configs/appConfig.ts) `// TIP: Сan be changed to sepolia testnet`
Initially, a new asset for voting is added on the smart contract side. But additional actions are also required on the UI side, namely:

4.1. Need to add the address of the new voting asset to the application config. [file](./src/configs/appConfigInit.ts) `// TIP: New address of the voting asset will be added here`

4.2. Need to add balance slot (or other slots) for new voting asset to balance slots config. [file](./src/helpers/getVoteBalanceSlot.ts) `// TIP: Balance slot (or other slots) for new voting asset are added here`

4.3. Need to add support for symbol and name of new asset for voting.

4.3.1. Add symbol. [file](./src/helpers/getAssetName.ts) `// TIP: Symbol for new voting asset is added here`

4.3.2. Add name. [file](./src/helpers/getAssetName.ts) `// TIP: Name for new voting asset is added here`

4.4. Need to update the string with symbols for tutorial modal windows and add a symbol of the new voting asset. [file](./src/components/TutorialModals/assets.ts) `// TIP: Just the string that is used in the tutorial, add the symbol of the new voting asset here`

### 5. How to change gov core to testnet?

5.1. Simply, need to change the core name to sepolia. [file](./src/configs/appConfig.ts) `// TIP: Сan be changed to sepolia testnet`

## License

Expand Down
2 changes: 1 addition & 1 deletion src/components/TutorialModals/assets.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const assets = 'AAVE + aAAVE + stkAAVE';
export const assets = 'AAVE + aAAVE + stkAAVE'; // TIP: Just the string that is used in the tutorial, add the symbol of the new voting asset here
2 changes: 2 additions & 0 deletions src/configs/appConfigInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ const aditionalsAddresses: Record<CoreNetworkName, Record<string, Hex>> = {
aaveAddress: AaveV3Ethereum.ASSETS.AAVE.UNDERLYING,
aAaveAddress: AaveV3Ethereum.ASSETS.AAVE.A_TOKEN,
stkAAVEAddress: AaveSafetyModule.STK_AAVE,
// TIP: New address of the voting asset will be added here

// for delegation
delegationHelper: GovernanceV3Ethereum.META_DELEGATE_HELPER,
},
Expand Down
10 changes: 10 additions & 0 deletions src/helpers/getAssetName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export function getAssetSymbolByAddress(address: string) {
return 'aAAVE';
case appConfig.additional.stkAAVEAddress.toLowerCase():
return 'stkAAVE';
// TIP: Symbol for new voting asset is added here
// example:
// case appConfig.additional.newVotingAsset.toLowerCase():
// return 'newVotingAssetSymbol';
}
}

Expand All @@ -27,5 +31,11 @@ export function getAssetNameByAddress(address: string) {
return getAssetName({
symbol: getAssetSymbolByAddress(address) ?? 'AAVE',
});
// TIP: Name for new voting asset is added here
// example:
// case appConfig.additional.newVotingAsset.toLowerCase():
// return getAssetName({
// symbol: getAssetSymbolByAddress(address) ?? 'AAVE',
// });
}
}
2 changes: 2 additions & 0 deletions src/helpers/getVoteBalanceSlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export const SLOTS: Record<
},
[appConfig.additional.aaveAddress.toLowerCase()]: { balance: 0 },
[appConfig.govCoreConfig.contractAddress.toLowerCase()]: { balance: 9 },
// TIP: Balance slot (or other slots) for new voting asset are added here
// example: [appConfig.additional.newVotingAsset.toLowerCase()]: { balance: 0 },
} as const;

export function formatBalances(balances: VotingDataByUser[]) {
Expand Down

1 comment on commit 6f6edfe

@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.