Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 6d95676

Browse files
authored
Merge pull request #70 from aave/feat/add-owner-parameter
Add owner parameter to support CREATE2 deployments
2 parents 2123361 + 444139a commit 6d95676

File tree

10 files changed

+108
-92
lines changed

10 files changed

+108
-92
lines changed

contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ import {ReentrancyGuard} from '../../dependencies/openzeppelin/ReentrancyGuard.s
1818
contract ParaSwapLiquiditySwapAdapter is BaseParaSwapSellAdapter, ReentrancyGuard {
1919
using SafeMath for uint256;
2020

21-
constructor(IPoolAddressesProvider addressesProvider, IParaSwapAugustusRegistry augustusRegistry)
22-
BaseParaSwapSellAdapter(addressesProvider, augustusRegistry)
23-
{
24-
// This is only required to initialize BaseParaSwapSellAdapter
21+
constructor(
22+
IPoolAddressesProvider addressesProvider,
23+
IParaSwapAugustusRegistry augustusRegistry,
24+
address owner
25+
) BaseParaSwapSellAdapter(addressesProvider, augustusRegistry) {
26+
transferOwnership(owner);
2527
}
2628

2729
/**

contracts/adapters/paraswap/ParaSwapRepayAdapter.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ contract ParaSwapRepayAdapter is BaseParaSwapBuyAdapter, ReentrancyGuard {
2828
bool useEthPath;
2929
}
3030

31-
constructor(IPoolAddressesProvider addressesProvider, IParaSwapAugustusRegistry augustusRegistry)
32-
BaseParaSwapBuyAdapter(addressesProvider, augustusRegistry)
33-
{
34-
// This is only required to initialize BaseParaSwapBuyAdapter
31+
constructor(
32+
IPoolAddressesProvider addressesProvider,
33+
IParaSwapAugustusRegistry augustusRegistry,
34+
address owner
35+
) BaseParaSwapBuyAdapter(addressesProvider, augustusRegistry) {
36+
transferOwnership(owner);
3537
}
3638

3739
/**

contracts/misc/WETHGateway.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ contract WETHGateway is IWETHGateway, Ownable {
2121
/**
2222
* @dev Sets the WETH address and the PoolAddressesProvider address. Infinite approves pool.
2323
* @param weth Address of the Wrapped Ether contract
24+
* @param owner Address of the owner of this contract
2425
**/
25-
constructor(address weth) {
26+
constructor(address weth, address owner) {
2627
WETH = IWETH(weth);
28+
transferOwnership(owner);
2729
}
2830

2931
function authorizePool(address pool) external onlyOwner {

package-lock.json

Lines changed: 49 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aave/periphery-v3",
3-
"version": "1.13.0",
3+
"version": "1.13.1-beta.1",
44
"description": "Aave Protocol V3 periphery smart contracts",
55
"files": [
66
"contracts",
@@ -32,7 +32,7 @@
3232
},
3333
"license": "AGPLv3",
3434
"devDependencies": {
35-
"@aave/deploy-v3": "^1.19.0",
35+
"@aave/deploy-v3": "^1.21.1-beta.4",
3636
"@ethersproject/abi": "^5.1.0",
3737
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.11",
3838
"@nomiclabs/hardhat-etherscan": "^2.1.1",
@@ -88,6 +88,6 @@
8888
"url": "git://github.com/aave/aave-v3-periphery"
8989
},
9090
"dependencies": {
91-
"@aave/core-v3": "^1.14.2"
91+
"@aave/core-v3": "^1.14.3-beta.0"
9292
}
9393
}

test/__setup.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { initializeMakeSuite } from './helpers/make-suite';
33

44
before(async () => {
55
if (process.env.EMPTY_RUN === 'true') {
6-
console.log('Skipping due empty test run.')
6+
console.log('Skipping due empty test run.');
77
return;
88
}
99
await hre.deployments.fixture(['market']);

test/paraswap/paraswapAdapters.liquiditySwap.spec.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
3535
let evmSnapshotId: string;
3636

3737
before(async () => {
38-
const { addressesProvider } = testEnv;
38+
const { addressesProvider, deployer } = testEnv;
3939

4040
mockAugustus = await new MockParaSwapAugustus__factory(await getFirstSigner()).deploy();
4141
mockAugustusRegistry = await new MockParaSwapAugustusRegistry__factory(
4242
await getFirstSigner()
4343
).deploy(mockAugustus.address);
4444
paraswapLiquiditySwapAdapter = await deployParaSwapLiquiditySwapAdapter(
4545
addressesProvider.address,
46-
mockAugustusRegistry.address
46+
mockAugustusRegistry.address,
47+
deployer.address
4748
);
4849
});
4950

@@ -58,28 +59,32 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
5859
describe('ParaSwapLiquiditySwapAdapter', () => {
5960
describe('constructor', () => {
6061
it('should deploy with correct parameters', async () => {
61-
const { addressesProvider } = testEnv;
62+
const { addressesProvider, deployer } = testEnv;
6263
await deployParaSwapLiquiditySwapAdapter(
6364
addressesProvider.address,
64-
mockAugustusRegistry.address
65+
mockAugustusRegistry.address,
66+
deployer.address
6567
);
6668
});
6769

6870
it('should revert if not valid addresses provider', async () => {
71+
const { deployer } = testEnv;
6972
await expect(
7073
deployParaSwapLiquiditySwapAdapter(
7174
mockAugustus.address, // any invalid contract can be used here
72-
mockAugustusRegistry.address
75+
mockAugustusRegistry.address,
76+
deployer.address
7377
)
7478
).to.be.reverted;
7579
});
7680

7781
it('should revert if not valid augustus registry', async () => {
78-
const { addressesProvider } = testEnv;
82+
const { addressesProvider, deployer } = testEnv;
7983
await expect(
8084
deployParaSwapLiquiditySwapAdapter(
8185
addressesProvider.address,
82-
mockAugustus.address // any invalid contract can be used here
86+
mockAugustus.address, // any invalid contract can be used here
87+
deployer.address
8388
)
8489
).to.be.reverted;
8590
});
@@ -2677,10 +2682,12 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
26772682

26782683
async function deployParaSwapLiquiditySwapAdapter(
26792684
poolAddressesProvider: tEthereumAddress,
2680-
augustusRegistry: tEthereumAddress
2685+
augustusRegistry: tEthereumAddress,
2686+
owner: tEthereumAddress
26812687
) {
26822688
return await new ParaSwapLiquiditySwapAdapter__factory(await getFirstSigner()).deploy(
26832689
poolAddressesProvider,
2684-
augustusRegistry
2690+
augustusRegistry,
2691+
owner
26852692
);
26862693
}

0 commit comments

Comments
 (0)