-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
77 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import * as fs from 'fs'; | ||
import {Addresses} from '../configs/types'; | ||
import { | ||
generateJsConstants, | ||
generateSolidityConstants, | ||
prefixWithGeneratedWarning, | ||
prefixWithPragma, | ||
wrapIntoSolidityLibrary, | ||
} from './utils'; | ||
import {ChainId} from '@bgd-labs/js-utils'; | ||
|
||
const v1Addresses: Addresses = { | ||
ADDRESSES_PROVIDER: '0x24a42fD28C976A61Df5D00D0599C34c4f90748c8', | ||
CORE: '0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3', | ||
POOL: '0x398eC7346DcD622eDc5ae82352F02bE94C62d119', | ||
}; | ||
|
||
export function generateAaveV1() { | ||
const name = 'AaveV1'; | ||
|
||
fs.writeFileSync( | ||
`./src/AaveV1.sol`, | ||
prefixWithGeneratedWarning( | ||
prefixWithPragma( | ||
wrapIntoSolidityLibrary( | ||
generateSolidityConstants({chainId: ChainId.mainnet, addresses: v1Addresses}), | ||
name, | ||
), | ||
), | ||
), | ||
); | ||
|
||
fs.writeFileSync( | ||
`./src/ts/AaveV1.ts`, | ||
prefixWithGeneratedWarning( | ||
generateJsConstants({ | ||
chainId: ChainId.mainnet, | ||
addresses: {...v1Addresses, CHAIN_ID: {value: 1, type: 'uint256'}}, | ||
}).join('\n'), | ||
), | ||
); | ||
|
||
return { | ||
js: [`export * as ${name} from './${name}';`], | ||
solidity: [`import {${name}} from './${name}.sol';`], | ||
}; | ||
} |
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,14 @@ | ||
// AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.6.0; | ||
|
||
library AaveV1 { | ||
// https://etherscan.io/address/0x24a42fD28C976A61Df5D00D0599C34c4f90748c8 | ||
address internal constant ADDRESSES_PROVIDER = 0x24a42fD28C976A61Df5D00D0599C34c4f90748c8; | ||
|
||
// https://etherscan.io/address/0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3 | ||
address internal constant CORE = 0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3; | ||
|
||
// https://etherscan.io/address/0x398eC7346DcD622eDc5ae82352F02bE94C62d119 | ||
address internal constant POOL = 0x398eC7346DcD622eDc5ae82352F02bE94C62d119; | ||
} |
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,11 @@ | ||
// AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR | ||
// https://etherscan.io/address/0x24a42fD28C976A61Df5D00D0599C34c4f90748c8 | ||
export const ADDRESSES_PROVIDER = '0x24a42fD28C976A61Df5D00D0599C34c4f90748c8'; | ||
|
||
// https://etherscan.io/address/0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3 | ||
export const CORE = '0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3'; | ||
|
||
// https://etherscan.io/address/0x398eC7346DcD622eDc5ae82352F02bE94C62d119 | ||
export const POOL = '0x398eC7346DcD622eDc5ae82352F02bE94C62d119'; | ||
|
||
export const CHAIN_ID = 1; |