diff --git a/safe.csv b/safe.csv index 9a83816c..2b725a1c 100644 --- a/safe.csv +++ b/safe.csv @@ -1051,6 +1051,7 @@ address,name,chainId 0x33AE1f41546a2e05368Bf789b3d868813c0Ae658,AaveV3Gnosis CAPS_PLUS_RISK_STEWARD,100 0x3e652E97ff339B73421f824F5b03d75b62F1Fb51,AaveV3Gnosis COLLECTOR,100 0x97CB9e81d480A2AB03299760654C1DDC0C16bE07,AaveV3Gnosis CONFIG_ENGINE,100 +0xE28E2c8d240dd5eBd0adcab86fbD79df7a052034,AaveV3Gnosis DEBT_SWAP_ADAPTER,100 0x589750BA8aF186cE5B55391B0b7148cAD43a1619,AaveV3Gnosis DEFAULT_A_TOKEN_IMPL_REV_1,100 0xaD4F91D26254B6B0C6346b390dDA2991FDE2F20d,AaveV3Gnosis DEFAULT_INCENTIVES_CONTROLLER,100 0xBeC519531F0E78BcDdB295242fA4EC5251B38574,AaveV3Gnosis DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1,100 @@ -1063,12 +1064,15 @@ address,name,chainId 0x7304979ec9E4EaA0273b6A037a31c4e9e5A75D16,AaveV3Gnosis POOL_CONFIGURATOR,100 0x4816b2C2895f97fB918f1aE7Da403750a0eE372e,AaveV3Gnosis POOL_CONFIGURATOR_IMPL,100 0xF2C312BfAF4CF0429DB4DA15a0cf5F770Ea3E770,AaveV3Gnosis POOL_IMPL,100 +0x86b0521f92a554057e54B93098BA2A6Aaa2F4ACB,AaveV3Gnosis REPAY_WITH_COLLATERAL_ADAPTER,100 0x677c9f358dA5DC83aF6760a839E4448D72840d04,AaveV3Gnosis RISK_STEWARD,100 0x02e9b27599C4Bf8f789d34b6E65C51092c3d9FA6,AaveV3Gnosis STATIC_A_TOKEN_FACTORY,100 +0x63dfa7c09Dc2Ff4030d6B8Dc2ce6262BF898C8A4,AaveV3Gnosis SWAP_COLLATERAL_ADAPTER,100 0x5d4D4007A4c6336550DdAa2a7c0d5e7972eebd16,AaveV3Gnosis UI_INCENTIVE_DATA_PROVIDER,100 0x5598BbFA2f4fE8151f45bBA0a3edE1b54B51a0a9,AaveV3Gnosis UI_POOL_DATA_PROVIDER,100 0x4172E6aAEC070ACB31aaCE343A58c93E4C70f44D,AaveV3Gnosis WALLET_BALANCE_PROVIDER,100 0x7B9c12915c594a68dE96201Cbdc79147F09da278,AaveV3Gnosis WETH_GATEWAY,100 +0xc0179321f0825c3e0F59Fe7Ca4E40557b97797a3,AaveV3Gnosis WITHDRAW_SWAP_ADAPTER,100 0xF937ffAeA1363e4Fa260760bDFA2aA8Fc911F84D,GovernanceV3Gnosis CL_EMERGENCY_ORACLE,100 0x8Dc5310fc9D3D7D1Bb3D1F686899c8F082316c9F,GovernanceV3Gnosis CROSS_CHAIN_CONTROLLER,100 0x1dF462e2712496373A347f8ad10802a5E95f053D,GovernanceV3Gnosis EXECUTOR_LVL_1,100 diff --git a/scripts/configs/pools/gnosis.ts b/scripts/configs/pools/gnosis.ts index e0df84c0..8157b4b1 100644 --- a/scripts/configs/pools/gnosis.ts +++ b/scripts/configs/pools/gnosis.ts @@ -16,5 +16,9 @@ export const gnosisProtoV3: PoolConfig = { RISK_STEWARD: '0x677c9f358dA5DC83aF6760a839E4448D72840d04', FREEZING_STEWARD: '0x3Ceaf9b6CAb92dFe6302D0CC3F1BA880C28d35e5', STATIC_A_TOKEN_FACTORY: '0x02e9b27599C4Bf8f789d34b6E65C51092c3d9FA6', + REPAY_WITH_COLLATERAL_ADAPTER: '0x86b0521f92a554057e54B93098BA2A6Aaa2F4ACB', + SWAP_COLLATERAL_ADAPTER: '0x63dfa7c09Dc2Ff4030d6B8Dc2ce6262BF898C8A4', + DEBT_SWAP_ADAPTER: '0xE28E2c8d240dd5eBd0adcab86fbD79df7a052034', + WITHDRAW_SWAP_ADAPTER: '0xc0179321f0825c3e0F59Fe7Ca4E40557b97797a3', }, }; diff --git a/src/AaveV3Gnosis.sol b/src/AaveV3Gnosis.sol index 3a665caf..5e136bbb 100644 --- a/src/AaveV3Gnosis.sol +++ b/src/AaveV3Gnosis.sol @@ -83,6 +83,19 @@ library AaveV3Gnosis { // https://gnosisscan.io/address/0x02e9b27599C4Bf8f789d34b6E65C51092c3d9FA6 address internal constant STATIC_A_TOKEN_FACTORY = 0x02e9b27599C4Bf8f789d34b6E65C51092c3d9FA6; + + // https://gnosisscan.io/address/0x86b0521f92a554057e54B93098BA2A6Aaa2F4ACB + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x86b0521f92a554057e54B93098BA2A6Aaa2F4ACB; + + // https://gnosisscan.io/address/0x63dfa7c09Dc2Ff4030d6B8Dc2ce6262BF898C8A4 + address internal constant SWAP_COLLATERAL_ADAPTER = 0x63dfa7c09Dc2Ff4030d6B8Dc2ce6262BF898C8A4; + + // https://gnosisscan.io/address/0xE28E2c8d240dd5eBd0adcab86fbD79df7a052034 + address internal constant DEBT_SWAP_ADAPTER = 0xE28E2c8d240dd5eBd0adcab86fbD79df7a052034; + + // https://gnosisscan.io/address/0xc0179321f0825c3e0F59Fe7Ca4E40557b97797a3 + address internal constant WITHDRAW_SWAP_ADAPTER = 0xc0179321f0825c3e0F59Fe7Ca4E40557b97797a3; } library AaveV3GnosisAssets { // https://gnosisscan.io/address/0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1 diff --git a/src/ts/AaveV3Gnosis.ts b/src/ts/AaveV3Gnosis.ts index 946ce5d3..0d580ed6 100644 --- a/src/ts/AaveV3Gnosis.ts +++ b/src/ts/AaveV3Gnosis.ts @@ -71,6 +71,18 @@ export const FREEZING_STEWARD = '0x3Ceaf9b6CAb92dFe6302D0CC3F1BA880C28d35e5'; // https://gnosisscan.io/address/0x02e9b27599C4Bf8f789d34b6E65C51092c3d9FA6 export const STATIC_A_TOKEN_FACTORY = '0x02e9b27599C4Bf8f789d34b6E65C51092c3d9FA6'; +// https://gnosisscan.io/address/0x86b0521f92a554057e54B93098BA2A6Aaa2F4ACB +export const REPAY_WITH_COLLATERAL_ADAPTER = '0x86b0521f92a554057e54B93098BA2A6Aaa2F4ACB'; + +// https://gnosisscan.io/address/0x63dfa7c09Dc2Ff4030d6B8Dc2ce6262BF898C8A4 +export const SWAP_COLLATERAL_ADAPTER = '0x63dfa7c09Dc2Ff4030d6B8Dc2ce6262BF898C8A4'; + +// https://gnosisscan.io/address/0xE28E2c8d240dd5eBd0adcab86fbD79df7a052034 +export const DEBT_SWAP_ADAPTER = '0xE28E2c8d240dd5eBd0adcab86fbD79df7a052034'; + +// https://gnosisscan.io/address/0xc0179321f0825c3e0F59Fe7Ca4E40557b97797a3 +export const WITHDRAW_SWAP_ADAPTER = '0xc0179321f0825c3e0F59Fe7Ca4E40557b97797a3'; + export const CHAIN_ID = 100; export const ASSETS = { WETH: { diff --git a/tests/cache/verified.json b/tests/cache/verified.json index 975359b9..6269dc9a 100644 --- a/tests/cache/verified.json +++ b/tests/cache/verified.json @@ -3341,6 +3341,18 @@ }, "0xCb45E82419baeBCC9bA8b1e5c7858e48A3B26Ea6": { "name": "GnosisSafeProxy" + }, + "0x86b0521f92a554057e54B93098BA2A6Aaa2F4ACB": { + "name": "ParaSwapRepayAdapter" + }, + "0xc0179321f0825c3e0F59Fe7Ca4E40557b97797a3": { + "name": "ParaSwapWithdrawSwapAdapter" + }, + "0x63dfa7c09Dc2Ff4030d6B8Dc2ce6262BF898C8A4": { + "name": "ParaSwapLiquiditySwapAdapter" + }, + "0xE28E2c8d240dd5eBd0adcab86fbD79df7a052034": { + "name": "ParaSwapDebtSwapAdapterV3" } }, "137": { diff --git a/tests/sanity/psp.spec.ts b/tests/sanity/psp.spec.ts new file mode 100644 index 00000000..505391a7 --- /dev/null +++ b/tests/sanity/psp.spec.ts @@ -0,0 +1,87 @@ +import {describe, it, expect} from 'vitest'; +import * as addressBook from '../../src/ts/AaveAddressBook'; +import {getContract} from 'viem'; +import {getClient} from '../../scripts/clients'; +import {getGovernance} from '../utils'; +import {IRiskSteward_ABI} from '../../src/ts/abis/IRiskSteward'; + +export async function checkGetters(address, addresses: Record) { + const client = getClient(addresses.CHAIN_ID); + const riskStewardContract = getContract({ + abi: [ + { + inputs: [], + name: 'ADDRESSES_PROVIDER', + outputs: [{internalType: 'contract IPoolAddressesProvider', name: '', type: 'address'}], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'AUGUSTUS_REGISTRY', + outputs: [{internalType: 'contract IParaSwapAugustusRegistry', name: '', type: 'address'}], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'ORACLE', + outputs: [{internalType: 'contract IPriceOracleGetter', name: '', type: 'address'}], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'POOL', + outputs: [{internalType: 'contract IPool', name: '', type: 'address'}], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [{internalType: 'address', name: '', type: 'address'}], + stateMutability: 'view', + type: 'function', + }, + ] as const, + address: address, + client, + }); + const [POOL, ORACLE, OWNER] = await Promise.all([ + riskStewardContract.read.POOL(), + riskStewardContract.read.ORACLE(), + riskStewardContract.read.owner(), + ]); + expect(POOL).toEqual(addresses.POOL); + expect(ORACLE).toEqual(addresses.ORACLE); + + const governance = getGovernance(addresses.CHAIN_ID); + if (!governance) { + console.log(`SANITY_PSP: Skipped due to missing governance on ${client.chain?.name}`); + } else { + const l1Executor = (governance as any).EXECUTOR_LVL_1; + expect(OWNER).toEqual(l1Executor); + } +} + +describe('paraswap adapters', () => { + it('should reference correct contracts on all getters', async () => { + await Promise.all( + Object.keys(addressBook).map((library) => { + const addresses = addressBook[library]; + // we currently only validate V3 adapters as v2 has no getters + if (library.startsWith('AaveV3')) { + if (addresses.REPAY_WITH_COLLATERAL_ADAPTER) + return checkGetters(addresses.REPAY_WITH_COLLATERAL_ADAPTER, addresses); + if (addresses.SWAP_COLLATERAL_ADAPTER) + return checkGetters(addresses.SWAP_COLLATERAL_ADAPTER, addresses); + if (addresses.DEBT_SWAP_ADAPTER) + return checkGetters(addresses.DEBT_SWAP_ADAPTER, addresses); + if (addresses.WITHDRAW_SWAP_ADAPTER) + return checkGetters(addresses.WITHDRAW_SWAP_ADAPTER, addresses); + } + }), + ); + }); +}); diff --git a/tests/verification.spec.ts b/tests/verification.spec.ts index e160f9d5..c9160219 100644 --- a/tests/verification.spec.ts +++ b/tests/verification.spec.ts @@ -116,6 +116,7 @@ describe( status: string; result: {ContractName: string}[]; }; + await sleep(300); if (status !== '1' || !result[0].ContractName) { errors.push({item, error: result}); } else {