Skip to content

Commit 7d706f0

Browse files
feat: upgrade factory (#95)
* feat: upgrade factory * fix: cleanup * fix: use local copy * fix: tests * fix: remove deployment of proxyAdmin * fix: update tests * fix: update utils to latest --------- Co-authored-by: Harsh Pandey <[email protected]>
1 parent 37bb873 commit 7d706f0

25 files changed

+57
-89
lines changed

foundry.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ test = 'tests'
44
script = 'scripts'
55
optimizer = true
66
optimizer_runs = 200
7-
solc = '0.8.20'
7+
solc = '0.8.22'
88
evm_version = 'shanghai'
99
bytecode_hash = 'none'
1010
ignored_warnings_from = ["src/periphery/contracts/treasury/RevenueSplitter.sol"]
1111
out = 'out'
1212
libs = ['lib']
1313
remappings = []
1414
fs_permissions = [
15-
{ access = "write", path = "./reports" },
16-
{ access = "read", path = "./out" },
17-
{ access = "read", path = "./config" },
15+
{ access = "write", path = "./reports" },
16+
{ access = "read", path = "./out" },
17+
{ access = "read", path = "./config" },
1818
]
1919
ffi = true
2020

lib/solidity-utils

Submodule solidity-utils updated 45 files

snapshots/StataTokenV2.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"deposit": "284677",
3-
"depositATokens": "220136",
4-
"redeem": "205767",
5-
"redeemAToken": "153413"
2+
"deposit": "283763",
3+
"depositATokens": "219223",
4+
"redeem": "205909",
5+
"redeemAToken": "152567"
66
}

src/contracts/extensions/stata-token/ERC20AaveLMUpgradeable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.17;
44
import {ERC20Upgradeable} from 'openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol';
55
import {IERC20} from 'openzeppelin-contracts/contracts/interfaces/IERC20.sol';
66
import {SafeERC20} from 'openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol';
7-
import {SafeCast} from 'solidity-utils/contracts/oz-common/SafeCast.sol';
7+
import {SafeCast} from 'openzeppelin-contracts/contracts/utils/math/SafeCast.sol';
88

99
import {IRewardsController} from '../../rewards/interfaces/IRewardsController.sol';
1010
import {IERC20AaveLM} from './interfaces/IERC20AaveLM.sol';

src/contracts/extensions/stata-token/StataTokenFactory.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.10;
33

4-
import {IERC20Metadata} from 'solidity-utils/contracts/oz-common/interfaces/IERC20Metadata.sol';
5-
import {ITransparentProxyFactory, ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol';
6-
import {Initializable} from 'solidity-utils/contracts/transparent-proxy/Initializable.sol';
4+
import {IERC20Metadata} from 'openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol';
5+
import {Initializable} from 'openzeppelin-contracts/contracts/proxy/utils/Initializable.sol';
6+
import {ITransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol';
77
import {IPool, DataTypes} from '../../../contracts/interfaces/IPool.sol';
88
import {StataTokenV2} from './StataTokenV2.sol';
99
import {IStataTokenFactory} from './interfaces/IStataTokenFactory.sol';
@@ -20,7 +20,7 @@ contract StataTokenFactory is Initializable, IStataTokenFactory {
2020
IPool public immutable POOL;
2121

2222
///@inheritdoc IStataTokenFactory
23-
address public immutable PROXY_ADMIN;
23+
address public immutable INITIAL_OWNER;
2424

2525
///@inheritdoc IStataTokenFactory
2626
ITransparentProxyFactory public immutable TRANSPARENT_PROXY_FACTORY;
@@ -35,12 +35,12 @@ contract StataTokenFactory is Initializable, IStataTokenFactory {
3535

3636
constructor(
3737
IPool pool,
38-
address proxyAdmin,
38+
address initialOwner,
3939
ITransparentProxyFactory transparentProxyFactory,
4040
address stataTokenImpl
4141
) {
4242
POOL = pool;
43-
PROXY_ADMIN = proxyAdmin;
43+
INITIAL_OWNER = initialOwner;
4444
TRANSPARENT_PROXY_FACTORY = transparentProxyFactory;
4545
STATA_TOKEN_IMPL = stataTokenImpl;
4646
}
@@ -62,7 +62,7 @@ contract StataTokenFactory is Initializable, IStataTokenFactory {
6262
);
6363
address stataToken = TRANSPARENT_PROXY_FACTORY.createDeterministic(
6464
STATA_TOKEN_IMPL,
65-
ProxyAdmin(PROXY_ADMIN),
65+
INITIAL_OWNER,
6666
abi.encodeWithSelector(
6767
StataTokenV2.initialize.selector,
6868
reserveData.aTokenAddress,

src/contracts/extensions/stata-token/interfaces/IStataTokenFactory.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ interface IStataTokenFactory {
1414
function POOL() external view returns (IPool);
1515

1616
/**
17-
* @notice The proxy admin used for all tokens created via the factory.
18-
* @return The proxy admin address.
17+
* @notice The initial owner used for all tokens created via the factory.
18+
* @return The address of the initial owner.
1919
*/
20-
function PROXY_ADMIN() external view returns (address);
20+
function INITIAL_OWNER() external view returns (address);
2121

2222
/**
2323
* @notice The proxy factory used for all tokens created via the stata factory.

src/contracts/extensions/v3-config-engine/AaveV3ConfigEngine.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.18;
33

4+
import {Address} from 'openzeppelin-contracts/contracts/utils/Address.sol';
45
import {CapsEngine} from './libraries/CapsEngine.sol';
56
import {BorrowEngine} from './libraries/BorrowEngine.sol';
67
import {CollateralEngine} from './libraries/CollateralEngine.sol';
78
import {RateEngine} from './libraries/RateEngine.sol';
89
import {PriceFeedEngine} from './libraries/PriceFeedEngine.sol';
910
import {EModeEngine} from './libraries/EModeEngine.sol';
1011
import {ListingEngine} from './libraries/ListingEngine.sol';
11-
import {Address} from 'solidity-utils/contracts/oz-common/Address.sol';
1212
import './IAaveV3ConfigEngine.sol';
1313

1414
/**

src/contracts/extensions/v3-config-engine/AaveV3Payload.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.0;
33

4-
import {Address} from 'solidity-utils/contracts/oz-common/Address.sol';
4+
import {Address} from 'openzeppelin-contracts/contracts/utils/Address.sol';
55
import {WadRayMath} from '../../protocol/libraries/math/WadRayMath.sol';
66
import {IAaveV3ConfigEngine as IEngine} from './IAaveV3ConfigEngine.sol';
77
import {EngineFlags} from './EngineFlags.sol';

src/contracts/extensions/v3-config-engine/libraries/EModeEngine.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.18;
33

4+
import {SafeCast} from 'openzeppelin-contracts/contracts/utils/math/SafeCast.sol';
45
import {EngineFlags} from '../EngineFlags.sol';
56
import {DataTypes} from '../../../protocol/libraries/types/DataTypes.sol';
6-
import {SafeCast} from 'solidity-utils/contracts/oz-common/SafeCast.sol';
77
import {PercentageMath} from '../../../protocol/libraries/math/PercentageMath.sol';
88
import {IAaveV3ConfigEngine as IEngine, IPoolConfigurator, IPool} from '../IAaveV3ConfigEngine.sol';
99

src/contracts/extensions/v3-config-engine/libraries/ListingEngine.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.18;
33

4+
import {Address} from 'openzeppelin-contracts/contracts/utils/Address.sol';
45
import {IAaveV3ConfigEngine as IEngine, IPoolConfigurator, IPool, IDefaultInterestRateStrategyV2} from '../IAaveV3ConfigEngine.sol';
56
import {PriceFeedEngine} from './PriceFeedEngine.sol';
67
import {CapsEngine} from './CapsEngine.sol';
78
import {BorrowEngine} from './BorrowEngine.sol';
89
import {CollateralEngine} from './CollateralEngine.sol';
910
import {EModeEngine} from './EModeEngine.sol';
1011
import {ConfiguratorInputTypes} from '../../../protocol/libraries/types/ConfiguratorInputTypes.sol';
11-
import {Address} from 'solidity-utils/contracts/oz-common/Address.sol';
1212
import {SafeCast} from '../../../dependencies/openzeppelin/contracts/SafeCast.sol';
1313

1414
library ListingEngine {

0 commit comments

Comments
 (0)