-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: misc js exports * fix: generator and some cleanup * fix: missing import
- Loading branch information
1 parent
a220f6a
commit 4112844
Showing
18 changed files
with
993 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as fs from 'fs'; | ||
import { | ||
generateGovV2Addresses, | ||
generateGovV2AddressesSol, | ||
} from './helpers'; | ||
import {GovernanceV2} from './config'; | ||
|
||
export function writeGovV2Templates(govV2Addresses: GovernanceV2): void { | ||
const templateGovV2Solidity = `// SPDX-License-Identifier: MIT | ||
// AUTOGENERATED - DON'T MANUALLY CHANGE | ||
pragma solidity >=0.6.0; | ||
pragma experimental ABIEncoderV2; | ||
import {IGovernanceStrategy} from './common/IGovernanceStrategy.sol'; | ||
import {IAaveGovernanceV2} from './common/IAaveGovernanceV2.sol'; | ||
library AaveGovernanceV2 { | ||
${generateGovV2AddressesSol(govV2Addresses)} | ||
} | ||
`; | ||
|
||
fs.writeFileSync(`./src/AaveGovernanceV2.sol`, templateGovV2Solidity); | ||
|
||
const templateGovV2Js = `// AUTOGENERATED - DON'T MANUALLY CHANGE | ||
${generateGovV2Addresses(govV2Addresses)}`; | ||
|
||
fs.writeFileSync(`./src/ts/AaveGovernanceV2.ts`, templateGovV2Js); | ||
fs.appendFileSync(`./src/ts/AaveAddressBook.ts`, `export * as AaveGovernanceV2 from './AaveGovernanceV2';\r\n`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as fs from 'fs'; | ||
import { | ||
generateMiscAddressesSol, | ||
generateMiscAddresses, | ||
} from './helpers'; | ||
import {Misc} from './config'; | ||
|
||
export function writeMiscTemplates(miscAddresses: Misc): void { | ||
const templateGovV2Solidity = `// SPDX-License-Identifier: MIT | ||
// AUTOGENERATED - DON'T MANUALLY CHANGE | ||
pragma solidity >=0.6.0; | ||
import {IAaveEcosystemReserveController} from './common/IAaveEcosystemReserveController.sol'; | ||
import {IStreamable} from './common/IStreamable.sol'; | ||
library AaveMisc { | ||
${generateMiscAddressesSol(miscAddresses)} | ||
} | ||
`; | ||
|
||
fs.writeFileSync(`./src/AaveMisc.sol`, templateGovV2Solidity); | ||
|
||
const templateGovV2Js = `// AUTOGENERATED - DON'T MANUALLY CHANGE | ||
${generateMiscAddresses(miscAddresses)}`; | ||
|
||
fs.writeFileSync(`./src/ts/AaveMisc.ts`, templateGovV2Js); | ||
fs.appendFileSync(`./src/ts/AaveAddressBook.ts`, `export * as AaveMisc from './AaveMisc';\r\n`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.