Skip to content

Commit

Permalink
feat: add stata v2 sepolia deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Sep 12, 2024
1 parent 1ff54b2 commit b056e44
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/configs/pools/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const sepoliaProtoV3: PoolConfig = {
WETH_GATEWAY: '0x387d311e47e80b498169e6fb51d3193167d89F7D',
STATIC_A_TOKEN_FACTORY: '0xd210dFB43B694430B8d31762B5199e30c31266C8',
UI_GHO_DATA_PROVIDER: '0x69B9843A16a6E9933125EBD97659BA3CCbE2Ef8A',
STATA_FACTORY: '0x29280281f05BFF1f59b1dA06B26adCB3b32a1838',
},
};

Expand Down
2 changes: 2 additions & 0 deletions scripts/configs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface PoolConfig {
DELEGATION_AWARE_A_TOKEN_IMPL_REV_1?: Hex;
STATIC_A_TOKEN_FACTORY?: Hex;
STATIC_A_TOKEN_ORACLE?: Hex;
STATA_FACTORY?: Hex;
CAPS_PLUS_RISK_STEWARD?: Hex;
RISK_STEWARD?: Hex;
FREEZING_STEWARD?: Hex;
Expand Down Expand Up @@ -86,6 +87,7 @@ export type ReserveData = {
INTEREST_RATE_STRATEGY: Hex;
ORACLE: Hex;
STATA_TOKEN?: Hex;
STATA_TOKENV2?: Hex;
};

/**
Expand Down
5 changes: 5 additions & 0 deletions scripts/generator/assetsLibraryGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export function generateAssetsLibrary(
};
if (rest.STATA_TOKEN && rest.STATA_TOKEN !== zeroAddress)
addresses[`${symbol}_STATA_TOKEN`] = rest.STATA_TOKEN;
if (rest.STATA_TOKENV2 && rest.STATA_TOKENV2 !== zeroAddress)
addresses[`${symbol}_STATA_TOKENV2`] = rest.STATA_TOKENV2;
return addresses;
});

Expand All @@ -85,6 +87,9 @@ export function generateAssetsLibrary(
if (rest.STATA_TOKEN && rest.STATA_TOKEN == zeroAddress) {
delete acc[symbol].STATA_TOKEN;
}
if (rest.STATA_TOKENV2 && rest.STATA_TOKENV2 == zeroAddress) {
delete acc[symbol].STATA_TOKENV2;
}
return acc;
},
{} as {[address: string]: {[key: string]: Hex | number}},
Expand Down
19 changes: 19 additions & 0 deletions scripts/generator/protocolV3Generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,21 @@ export async function getPoolV3Addresses(
client,
})
: null;
const stataTokenFactoryContract = pool.additionalAddresses.STATA_FACTORY
? getContract({
address: pool.additionalAddresses.STATA_FACTORY,
abi: [
{
inputs: [{internalType: 'address', name: 'underlying', type: 'address'}],
name: 'getStataToken',
outputs: [{internalType: 'address', name: '', type: 'address'}],
stateMutability: 'view',
type: 'function',
},
] as const,
client,
})
: null;
const data = (
await uiPoolDataProvider.read.getReservesData([pool.POOL_ADDRESSES_PROVIDER])
)[0];
Expand All @@ -228,6 +243,10 @@ export async function getPoolV3Addresses(
result.STATA_TOKEN = (await staticATokenFactoryContract.read.getStaticAToken([
reserve.underlyingAsset,
])) as Hex;
if (stataTokenFactoryContract)
result.STATA_TOKENV2 = (await stataTokenFactoryContract.read.getStataToken([
reserve.underlyingAsset,
])) as Hex;
return result;
}),
);
Expand Down
30 changes: 30 additions & 0 deletions src/AaveV3Sepolia.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ library AaveV3Sepolia {

// https://sepolia.etherscan.io/address/0x69B9843A16a6E9933125EBD97659BA3CCbE2Ef8A
address internal constant UI_GHO_DATA_PROVIDER = 0x69B9843A16a6E9933125EBD97659BA3CCbE2Ef8A;

// https://sepolia.etherscan.io/address/0x29280281f05BFF1f59b1dA06B26adCB3b32a1838
address internal constant STATA_FACTORY = 0x29280281f05BFF1f59b1dA06B26adCB3b32a1838;
}

library AaveV3SepoliaAssets {
Expand All @@ -104,6 +107,9 @@ library AaveV3SepoliaAssets {
// https://sepolia.etherscan.io/address/0xDE46e43F46ff74A23a65EBb0580cbe3dFE684a17
address internal constant DAI_STATA_TOKEN = 0xDE46e43F46ff74A23a65EBb0580cbe3dFE684a17;

// https://sepolia.etherscan.io/address/0x23f9F8388A3De38AAa02c9448E1457795448c046
address internal constant DAI_STATA_TOKENV2 = 0x23f9F8388A3De38AAa02c9448E1457795448c046;

// https://sepolia.etherscan.io/address/0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5
address internal constant LINK_UNDERLYING = 0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5;

Expand All @@ -128,6 +134,9 @@ library AaveV3SepoliaAssets {
// https://sepolia.etherscan.io/address/0x8227a989709a757f25dF251C3C3e71CA38627836
address internal constant LINK_STATA_TOKEN = 0x8227a989709a757f25dF251C3C3e71CA38627836;

// https://sepolia.etherscan.io/address/0x505060bc5b8913476692142b1b53aA0e33Da2f0D
address internal constant LINK_STATA_TOKENV2 = 0x505060bc5b8913476692142b1b53aA0e33Da2f0D;

// https://sepolia.etherscan.io/address/0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8
address internal constant USDC_UNDERLYING = 0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8;

Expand All @@ -152,6 +161,9 @@ library AaveV3SepoliaAssets {
// https://sepolia.etherscan.io/address/0x8A88124522dbBF1E56352ba3DE1d9F78C143751e
address internal constant USDC_STATA_TOKEN = 0x8A88124522dbBF1E56352ba3DE1d9F78C143751e;

// https://sepolia.etherscan.io/address/0x6586F919E7Df76e6055b60aDFBAEF2D506Fb80AF
address internal constant USDC_STATA_TOKENV2 = 0x6586F919E7Df76e6055b60aDFBAEF2D506Fb80AF;

// https://sepolia.etherscan.io/address/0x29f2D40B0605204364af54EC677bD022dA425d03
address internal constant WBTC_UNDERLYING = 0x29f2D40B0605204364af54EC677bD022dA425d03;

Expand All @@ -176,6 +188,9 @@ library AaveV3SepoliaAssets {
// https://sepolia.etherscan.io/address/0x131a121bda71ED810bCAf2aC9079214925e59C18
address internal constant WBTC_STATA_TOKEN = 0x131a121bda71ED810bCAf2aC9079214925e59C18;

// https://sepolia.etherscan.io/address/0xaA87c7499DeAD6d8b54a5F7315005FA01317C43e
address internal constant WBTC_STATA_TOKENV2 = 0xaA87c7499DeAD6d8b54a5F7315005FA01317C43e;

// https://sepolia.etherscan.io/address/0xC558DBdd856501FCd9aaF1E62eae57A9F0629a3c
address internal constant WETH_UNDERLYING = 0xC558DBdd856501FCd9aaF1E62eae57A9F0629a3c;

Expand All @@ -200,6 +215,9 @@ library AaveV3SepoliaAssets {
// https://sepolia.etherscan.io/address/0x162B500569F42D9eCe937e6a61EDfef660A12E98
address internal constant WETH_STATA_TOKEN = 0x162B500569F42D9eCe937e6a61EDfef660A12E98;

// https://sepolia.etherscan.io/address/0xBD18EDA83a10Bb6719575Af3D7Ff77c482aC7859
address internal constant WETH_STATA_TOKENV2 = 0xBD18EDA83a10Bb6719575Af3D7Ff77c482aC7859;

// https://sepolia.etherscan.io/address/0xaA8E23Fb1079EA71e0a56F48a2aA51851D8433D0
address internal constant USDT_UNDERLYING = 0xaA8E23Fb1079EA71e0a56F48a2aA51851D8433D0;

Expand All @@ -224,6 +242,9 @@ library AaveV3SepoliaAssets {
// https://sepolia.etherscan.io/address/0x978206fAe13faF5a8d293FB614326B237684B750
address internal constant USDT_STATA_TOKEN = 0x978206fAe13faF5a8d293FB614326B237684B750;

// https://sepolia.etherscan.io/address/0x62Fd6D5Ee0DE6b2E583217b83c07793E4A1A10Cf
address internal constant USDT_STATA_TOKENV2 = 0x62Fd6D5Ee0DE6b2E583217b83c07793E4A1A10Cf;

// https://sepolia.etherscan.io/address/0x88541670E55cC00bEEFD87eB59EDd1b7C511AC9a
address internal constant AAVE_UNDERLYING = 0x88541670E55cC00bEEFD87eB59EDd1b7C511AC9a;

Expand All @@ -248,6 +269,9 @@ library AaveV3SepoliaAssets {
// https://sepolia.etherscan.io/address/0x56771cEF0cb422e125564CcCC98BB05fdc718E77
address internal constant AAVE_STATA_TOKEN = 0x56771cEF0cb422e125564CcCC98BB05fdc718E77;

// https://sepolia.etherscan.io/address/0x9b8620D18369983e53825b665fef191327d634D9
address internal constant AAVE_STATA_TOKENV2 = 0x9b8620D18369983e53825b665fef191327d634D9;

// https://sepolia.etherscan.io/address/0x6d906e526a4e2Ca02097BA9d0caA3c382F52278E
address internal constant EURS_UNDERLYING = 0x6d906e526a4e2Ca02097BA9d0caA3c382F52278E;

Expand All @@ -272,6 +296,9 @@ library AaveV3SepoliaAssets {
// https://sepolia.etherscan.io/address/0x72B49a461900e11632C95dfa563e7173438D4e3E
address internal constant EURS_STATA_TOKEN = 0x72B49a461900e11632C95dfa563e7173438D4e3E;

// https://sepolia.etherscan.io/address/0x550d7b2bA24F7189cA2Bfa91fCCdC7d1741a15D7
address internal constant EURS_STATA_TOKENV2 = 0x550d7b2bA24F7189cA2Bfa91fCCdC7d1741a15D7;

// https://sepolia.etherscan.io/address/0xc4bF5CbDaBE595361438F8c6a187bDc330539c60
address internal constant GHO_UNDERLYING = 0xc4bF5CbDaBE595361438F8c6a187bDc330539c60;

Expand All @@ -291,6 +318,9 @@ library AaveV3SepoliaAssets {

// https://sepolia.etherscan.io/address/0x521247B4d0a51E71DE580dA2cBF99EB40a44b3Bf
address internal constant GHO_INTEREST_RATE_STRATEGY = 0x521247B4d0a51E71DE580dA2cBF99EB40a44b3Bf;

// https://sepolia.etherscan.io/address/0xb147BbC81a18B990F8C513bEEfad436CD9525679
address internal constant GHO_STATA_TOKENV2 = 0xb147BbC81a18B990F8C513bEEfad436CD9525679;
}

library AaveV3SepoliaEModes {
Expand Down
12 changes: 12 additions & 0 deletions src/ts/AaveV3Sepolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export const STATIC_A_TOKEN_FACTORY = '0xd210dFB43B694430B8d31762B5199e30c31266C
// https://sepolia.etherscan.io/address/0x69B9843A16a6E9933125EBD97659BA3CCbE2Ef8A
export const UI_GHO_DATA_PROVIDER = '0x69B9843A16a6E9933125EBD97659BA3CCbE2Ef8A';

// https://sepolia.etherscan.io/address/0x29280281f05BFF1f59b1dA06B26adCB3b32a1838
export const STATA_FACTORY = '0x29280281f05BFF1f59b1dA06B26adCB3b32a1838';

export const CHAIN_ID = 11155111;
export const ASSETS = {
DAI: {
Expand All @@ -76,6 +79,7 @@ export const ASSETS = {
INTEREST_RATE_STRATEGY: '0xA813CC4d67821fbAcF24659e414A1Cf6c551373c',
ORACLE: '0x9aF11c35c5d3Ae182C0050438972aac4376f9516',
STATA_TOKEN: '0xDE46e43F46ff74A23a65EBb0580cbe3dFE684a17',
STATA_TOKENV2: '0x23f9F8388A3De38AAa02c9448E1457795448c046',
},
LINK: {
decimals: 18,
Expand All @@ -86,6 +90,7 @@ export const ASSETS = {
INTEREST_RATE_STRATEGY: '0xCA30c502d52F905FB3D04eE60cA48F5A1A89f8dB',
ORACLE: '0x14fC51b7df22b4D393cD45504B9f0A3002A63F3F',
STATA_TOKEN: '0x8227a989709a757f25dF251C3C3e71CA38627836',
STATA_TOKENV2: '0x505060bc5b8913476692142b1b53aA0e33Da2f0D',
},
USDC: {
decimals: 6,
Expand All @@ -96,6 +101,7 @@ export const ASSETS = {
INTEREST_RATE_STRATEGY: '0x5CB1008969a2d5FAcE8eF32732e6A306d0D0EF2A',
ORACLE: '0x98458D6A99489F15e6eB5aFa67ACFAcf6F211051',
STATA_TOKEN: '0x8A88124522dbBF1E56352ba3DE1d9F78C143751e',
STATA_TOKENV2: '0x6586F919E7Df76e6055b60aDFBAEF2D506Fb80AF',
},
WBTC: {
decimals: 8,
Expand All @@ -106,6 +112,7 @@ export const ASSETS = {
INTEREST_RATE_STRATEGY: '0xCA30c502d52F905FB3D04eE60cA48F5A1A89f8dB',
ORACLE: '0x784B90bA1E9a8cf3C9939c2e072F058B024C4b8a',
STATA_TOKEN: '0x131a121bda71ED810bCAf2aC9079214925e59C18',
STATA_TOKENV2: '0xaA87c7499DeAD6d8b54a5F7315005FA01317C43e',
},
WETH: {
decimals: 18,
Expand All @@ -116,6 +123,7 @@ export const ASSETS = {
INTEREST_RATE_STRATEGY: '0xCA30c502d52F905FB3D04eE60cA48F5A1A89f8dB',
ORACLE: '0xDde0E8E6d3653614878Bf5009EDC317BC129fE2F',
STATA_TOKEN: '0x162B500569F42D9eCe937e6a61EDfef660A12E98',
STATA_TOKENV2: '0xBD18EDA83a10Bb6719575Af3D7Ff77c482aC7859',
},
USDT: {
decimals: 6,
Expand All @@ -126,6 +134,7 @@ export const ASSETS = {
INTEREST_RATE_STRATEGY: '0x5CB1008969a2d5FAcE8eF32732e6A306d0D0EF2A',
ORACLE: '0x4e86D3Aa271Fa418F38D7262fdBa2989C94aa5Ba',
STATA_TOKEN: '0x978206fAe13faF5a8d293FB614326B237684B750',
STATA_TOKENV2: '0x62Fd6D5Ee0DE6b2E583217b83c07793E4A1A10Cf',
},
AAVE: {
decimals: 18,
Expand All @@ -136,6 +145,7 @@ export const ASSETS = {
INTEREST_RATE_STRATEGY: '0xCA30c502d52F905FB3D04eE60cA48F5A1A89f8dB',
ORACLE: '0xda678Ef100c13504edDb8a228A1e8e4CB139f189',
STATA_TOKEN: '0x56771cEF0cb422e125564CcCC98BB05fdc718E77',
STATA_TOKENV2: '0x9b8620D18369983e53825b665fef191327d634D9',
},
EURS: {
decimals: 2,
Expand All @@ -146,6 +156,7 @@ export const ASSETS = {
INTEREST_RATE_STRATEGY: '0x5CB1008969a2d5FAcE8eF32732e6A306d0D0EF2A',
ORACLE: '0xCbE15C1f40f1D7eE1De3756D1557d5Fdc2A50bBD',
STATA_TOKEN: '0x72B49a461900e11632C95dfa563e7173438D4e3E',
STATA_TOKENV2: '0x550d7b2bA24F7189cA2Bfa91fCCdC7d1741a15D7',
},
GHO: {
decimals: 18,
Expand All @@ -155,6 +166,7 @@ export const ASSETS = {
V_TOKEN: '0x67ae46EF043F7A4508BD1d6B94DB6c33F0915844',
INTEREST_RATE_STRATEGY: '0x521247B4d0a51E71DE580dA2cBF99EB40a44b3Bf',
ORACLE: '0x00f7fecFAEbEd9499e1f3f9d04E755a21E5fc47C',
STATA_TOKENV2: '0xb147BbC81a18B990F8C513bEEfad436CD9525679',
},
} as const;
export const E_MODES = {
Expand Down

0 comments on commit b056e44

Please sign in to comment.