Skip to content

Commit

Permalink
🐛 fix issue on RiskStewards contract name (aave-dao#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinGbz authored Jan 15, 2025
1 parent b0bc479 commit 72e78d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions generator/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export function getPoolChain(pool: PoolIdentifier) {
return chain;
}

export function getPoolSuffix(pool: PoolIdentifier) {
return pool.replace('AaveV3', '');
}

export function getDate() {
const date = new Date();
const years = date.getFullYear();
Expand Down
15 changes: 12 additions & 3 deletions generator/templates/proposal.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import {generateContractName, getPoolChain, generateFolderName, getChainAlias} from '../common';
import {
generateContractName,
getPoolChain,
generateFolderName,
getChainAlias,
getPoolSuffix,
} from '../common';
import {Options, PoolConfig, PoolIdentifier} from '../types';
import {prefixWithImports} from '../utils/importsResolver';
import {prefixWithPragma} from '../utils/constants';
Expand All @@ -10,6 +16,7 @@ export const proposalTemplate = (
) => {
const {title, author, discussion} = options;
const chain = getPoolChain(pool);
const poolSuffix = getPoolSuffix(pool);

const folderName = generateFolderName(options);
const contractName = generateContractName(options, pool);
Expand All @@ -24,11 +31,13 @@ export const proposalTemplate = (
* @title ${title || 'TODO'}
* @author ${author || 'TODO'}
* - discussion: ${discussion || 'TODO'}
* - deploy-command: make run-script contract=${chain == 'ZkSync' ? 'zksync/' : ''}src/contracts/updates/${folderName}/${contractName}.sol:${contractName} network=${getChainAlias(
* - deploy-command: make run-script contract=${
chain == 'ZkSync' ? 'zksync/' : ''
}src/contracts/updates/${folderName}/${contractName}.sol:${contractName} network=${getChainAlias(
chain
)} broadcast=false generate_diff=true skip_timelock=false
*/
contract ${contractName} is ${`RiskStewards${chain === 'Base' ? 'BaseChain' : chain}`} {
contract ${contractName} is ${`RiskStewards${poolSuffix === 'Base' ? 'BaseChain' : poolSuffix}`} {
function name() public pure override returns (string memory) {
return '${contractName}';
}
Expand Down

0 comments on commit 72e78d7

Please sign in to comment.