Skip to content

Commit

Permalink
fix: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Jan 30, 2025
2 parents ad00e17 + ae2d19f commit 4ac35e5
Show file tree
Hide file tree
Showing 32 changed files with 89 additions and 167 deletions.
8 changes: 4 additions & 4 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ test = 'tests'
script = 'scripts'
optimizer = true
optimizer_runs = 200
solc = '0.8.20'
solc = '0.8.22'
evm_version = 'shanghai'
bytecode_hash = 'none'
ignored_warnings_from = ["src/periphery/contracts/treasury/RevenueSplitter.sol"]
out = 'out'
libs = ['lib']
remappings = []
fs_permissions = [
{ access = "write", path = "./reports" },
{ access = "read", path = "./out" },
{ access = "read", path = "./config" },
{ access = "write", path = "./reports" },
{ access = "read", path = "./out" },
{ access = "read", path = "./config" },
]
ffi = true

Expand Down
2 changes: 1 addition & 1 deletion lib/forge-std
2 changes: 1 addition & 1 deletion lib/solidity-utils
Submodule solidity-utils updated 45 files
+1 −0 .gitmodules
+5 −9 Makefile
+35 −36 foundry.toml
+1 −1 lib/forge-std
+1 −1 lib/openzeppelin-contracts-upgradeable
+2 −2 script/DeployTransparentProxyFactory.s.sol
+6 −5 src/contracts/access-control/OwnableWithGuardian.sol
+13 −11 src/contracts/access-control/UpgradeableOwnableWithGuardian.sol
+10 −0 src/contracts/access-control/interfaces/IWithGuardian.sol
+0 −248 src/contracts/oz-common/Address.sol
+0 −25 src/contracts/oz-common/Context.sol
+0 −378 src/contracts/oz-common/EnumerableSet.sol
+0 −84 src/contracts/oz-common/Ownable.sol
+0 −1,136 src/contracts/oz-common/SafeCast.sol
+0 −141 src/contracts/oz-common/SafeERC20.sol
+0 −89 src/contracts/oz-common/StorageSlot.sol
+0 −79 src/contracts/oz-common/interfaces/IERC20.sol
+0 −29 src/contracts/oz-common/interfaces/IERC20Metadata.sol
+0 −60 src/contracts/oz-common/interfaces/IERC20Permit.sol
+2 −2 src/contracts/oz-common/interfaces/IERC20WithPermit.sol
+0 −157 src/contracts/transparent-proxy/Initializable.sol
+0 −92 src/contracts/transparent-proxy/Proxy.sol
+0 −45 src/contracts/transparent-proxy/ProxyAdmin.sol
+0 −1 src/contracts/transparent-proxy/TransparentProxyFactory.sol
+55 −17 src/contracts/transparent-proxy/TransparentProxyFactoryBase.sol
+0 −125 src/contracts/transparent-proxy/TransparentUpgradeableProxy.sol
+15 −0 src/contracts/transparent-proxy/interfaces/IProxyAdminOzV4.sol
+16 −14 src/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol
+1 −1 src/contracts/utils/PermissionlessRescuable.sol
+1 −1 src/contracts/utils/Rescuable.sol
+1 −1 src/contracts/utils/RescuableACL.sol
+2 −2 src/contracts/utils/RescuableBase.sol
+3 −3 src/mocks/ERC20.sol
+894 −893 src/mocks/ERC721.sol
+1 −1 src/mocks/MockImpl.sol
+10 −4 test/OwnableWithGuardian.t.sol
+3 −3 test/PermissionlessRescuable.t.sol
+2 −2 test/Rescuable.t.sol
+1 −1 test/Rescuable721.t.sol
+2 −2 test/RescuableACL.t.sol
+27 −19 test/TransparentProxyFactory.t.sol
+6 −16 test/UpgradeableOwnableWithGuardian.t.sol
+2 −3 test/create3Test.t.sol
+10 −1 zksync/src/contracts/transparent-proxy/TransparentProxyFactoryZkSync.sol
+25 −11 zksync/test/TransparentProxyFactoryZkSync.t.sol
19 changes: 8 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"prettier-plugin-solidity": "^1.1.1"
},
"dependencies": {
"@bgd-labs/aave-cli": "^1.1.12",
"catapulta-verify": "^1.2.1"
"@bgd-labs/aave-cli": "^1.1.14",
"catapulta-verify": "^1.3.0"
}
}
2 changes: 1 addition & 1 deletion snapshots/Pool.Operations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"borrow: first borrow->borrowingEnabled": "256480",
"borrow: recurrent borrow": "248834",
"liquidationCall: deficit on liquidated asset": "392439",
"liquidationCall: deficit on liquidated asset + other asset": "492078",
"liquidationCall: deficit on liquidated asset + other asset": "491810",
"liquidationCall: full liquidation": "392439",
"liquidationCall: full liquidation and receive ATokens": "368797",
"liquidationCall: partial liquidation": "383954",
Expand Down
8 changes: 4 additions & 4 deletions snapshots/StataTokenV2.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"deposit": "281869",
"depositATokens": "220224",
"redeem": "205695",
"redeemAToken": "153479"
"deposit": "280955",
"depositATokens": "219311",
"redeem": "205837",
"redeemAToken": "152633"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.17;
import {ERC20Upgradeable} from 'openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol';
import {IERC20} from 'openzeppelin-contracts/contracts/interfaces/IERC20.sol';
import {SafeERC20} from 'openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol';
import {SafeCast} from 'solidity-utils/contracts/oz-common/SafeCast.sol';
import {SafeCast} from 'openzeppelin-contracts/contracts/utils/math/SafeCast.sol';

import {IRewardsController} from '../../rewards/interfaces/IRewardsController.sol';
import {IERC20AaveLM} from './interfaces/IERC20AaveLM.sol';
Expand Down
14 changes: 7 additions & 7 deletions src/contracts/extensions/stata-token/StataTokenFactory.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.10;

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

///@inheritdoc IStataTokenFactory
address public immutable PROXY_ADMIN;
address public immutable INITIAL_OWNER;

///@inheritdoc IStataTokenFactory
ITransparentProxyFactory public immutable TRANSPARENT_PROXY_FACTORY;
Expand All @@ -35,12 +35,12 @@ contract StataTokenFactory is Initializable, IStataTokenFactory {

constructor(
IPool pool,
address proxyAdmin,
address initialOwner,
ITransparentProxyFactory transparentProxyFactory,
address stataTokenImpl
) {
POOL = pool;
PROXY_ADMIN = proxyAdmin;
INITIAL_OWNER = initialOwner;
TRANSPARENT_PROXY_FACTORY = transparentProxyFactory;
STATA_TOKEN_IMPL = stataTokenImpl;
}
Expand All @@ -58,7 +58,7 @@ contract StataTokenFactory is Initializable, IStataTokenFactory {
bytes memory symbol = abi.encodePacked('w', IERC20Metadata(aTokenAddress).symbol());
address stataToken = TRANSPARENT_PROXY_FACTORY.createDeterministic(
STATA_TOKEN_IMPL,
ProxyAdmin(PROXY_ADMIN),
INITIAL_OWNER,
abi.encodeWithSelector(
StataTokenV2.initialize.selector,
aTokenAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ interface IStataTokenFactory {
function POOL() external view returns (IPool);

/**
* @notice The proxy admin used for all tokens created via the factory.
* @return The proxy admin address.
* @notice The initial owner used for all tokens created via the factory.
* @return The address of the initial owner.
*/
function PROXY_ADMIN() external view returns (address);
function INITIAL_OWNER() external view returns (address);

/**
* @notice The proxy factory used for all tokens created via the stata factory.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import {Address} from 'openzeppelin-contracts/contracts/utils/Address.sol';
import {CapsEngine} from './libraries/CapsEngine.sol';
import {BorrowEngine} from './libraries/BorrowEngine.sol';
import {CollateralEngine} from './libraries/CollateralEngine.sol';
import {RateEngine} from './libraries/RateEngine.sol';
import {PriceFeedEngine} from './libraries/PriceFeedEngine.sol';
import {EModeEngine} from './libraries/EModeEngine.sol';
import {ListingEngine} from './libraries/ListingEngine.sol';
import {Address} from 'solidity-utils/contracts/oz-common/Address.sol';
import './IAaveV3ConfigEngine.sol';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import {Address} from 'solidity-utils/contracts/oz-common/Address.sol';
import {Address} from 'openzeppelin-contracts/contracts/utils/Address.sol';
import {WadRayMath} from '../../protocol/libraries/math/WadRayMath.sol';
import {IAaveV3ConfigEngine as IEngine} from './IAaveV3ConfigEngine.sol';
import {EngineFlags} from './EngineFlags.sol';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import {SafeCast} from 'openzeppelin-contracts/contracts/utils/math/SafeCast.sol';
import {EngineFlags} from '../EngineFlags.sol';
import {DataTypes} from '../../../protocol/libraries/types/DataTypes.sol';
import {SafeCast} from 'solidity-utils/contracts/oz-common/SafeCast.sol';
import {PercentageMath} from '../../../protocol/libraries/math/PercentageMath.sol';
import {IAaveV3ConfigEngine as IEngine, IPoolConfigurator, IPool} from '../IAaveV3ConfigEngine.sol';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import {Address} from 'openzeppelin-contracts/contracts/utils/Address.sol';
import {IAaveV3ConfigEngine as IEngine, IPoolConfigurator, IPool, IDefaultInterestRateStrategyV2} from '../IAaveV3ConfigEngine.sol';
import {PriceFeedEngine} from './PriceFeedEngine.sol';
import {CapsEngine} from './CapsEngine.sol';
import {BorrowEngine} from './BorrowEngine.sol';
import {CollateralEngine} from './CollateralEngine.sol';
import {EModeEngine} from './EModeEngine.sol';
import {ConfiguratorInputTypes} from '../../../protocol/libraries/types/ConfiguratorInputTypes.sol';
import {Address} from 'solidity-utils/contracts/oz-common/Address.sol';
import {SafeCast} from '../../../dependencies/openzeppelin/contracts/SafeCast.sol';

library ListingEngine {
Expand Down
1 change: 1 addition & 0 deletions src/contracts/treasury/Collector.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ contract Collector is VersionedInitializable, ICollector, ReentrancyGuard {
_nextStreamId = nextStreamId;
}

_initGuard();
_setFundsAdmin(fundsAdmin);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.0;

import '../../interfaces/IMarketReportTypes.sol';
import {ITransparentProxyFactory, ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol';
import {ITransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol';
import {TransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/TransparentProxyFactory.sol';
import {StataTokenV2} from '../../../contracts/extensions/stata-token/StataTokenV2.sol';
import {StataTokenFactory} from '../../../contracts/extensions/stata-token/StataTokenFactory.sol';
Expand All @@ -12,9 +12,9 @@ contract AaveV3HelpersProcedureTwo is IErrors {
function _deployStaticAToken(
address pool,
address rewardsController,
address proxyAdmin
address poolAdmin
) internal returns (StaticATokenReport memory staticATokenReport) {
if (proxyAdmin == address(0)) revert ProxyAdminNotFound();
if (poolAdmin == address(0)) revert PoolAdminNotFound();

staticATokenReport.transparentProxyFactory = address(new TransparentProxyFactory());
staticATokenReport.staticATokenImplementation = address(
Expand All @@ -23,7 +23,7 @@ contract AaveV3HelpersProcedureTwo is IErrors {
staticATokenReport.staticATokenFactoryImplementation = address(
new StataTokenFactory(
IPool(pool),
proxyAdmin,
poolAdmin,
ITransparentProxyFactory(staticATokenReport.transparentProxyFactory),
staticATokenReport.staticATokenImplementation
)
Expand All @@ -33,7 +33,7 @@ contract AaveV3HelpersProcedureTwo is IErrors {
staticATokenReport.transparentProxyFactory
).create(
staticATokenReport.staticATokenFactoryImplementation,
ProxyAdmin(proxyAdmin),
poolAdmin,
abi.encodeWithSelector(StataTokenFactory.initialize.selector)
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol';
import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol';
import {TransparentUpgradeableProxy} from 'openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol';
import {Collector} from '../../../contracts/treasury/Collector.sol';
import '../../interfaces/IMarketReportTypes.sol';

Expand All @@ -14,7 +13,6 @@ contract AaveV3TreasuryProcedure {

function _deployAaveV3Treasury(
address poolAdmin,
address deployedProxyAdmin,
bytes32 collectorSalt
) internal returns (TreasuryReport memory) {
TreasuryReport memory treasuryReport;
Expand All @@ -29,7 +27,7 @@ contract AaveV3TreasuryProcedure {
treasuryReport.treasury = address(
new TransparentUpgradeableProxy{salt: salt}(
treasuryReport.treasuryImplementation,
ProxyAdmin(deployedProxyAdmin),
poolAdmin,
abi.encodeWithSelector(
treasuryImplementation.initialize.selector,
address(treasuryOwner),
Expand All @@ -45,7 +43,7 @@ contract AaveV3TreasuryProcedure {
treasuryReport.treasury = address(
new TransparentUpgradeableProxy(
treasuryReport.treasuryImplementation,
ProxyAdmin(deployedProxyAdmin),
poolAdmin,
abi.encodeWithSelector(
treasuryImplementation.initialize.selector,
address(treasuryOwner),
Expand Down
1 change: 0 additions & 1 deletion src/deployments/contracts/utilities/MarketReportUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ library MarketReportUtils {
defaultInterestRateStrategy: IDefaultInterestRateStrategyV2(
report.defaultInterestRateStrategy
),
proxyAdmin: ProxyAdmin(report.proxyAdmin),
treasuryImplementation: ICollector(report.treasuryImplementation),
wrappedTokenGateway: IWrappedTokenGatewayV3(report.wrappedTokenGateway),
walletBalanceProvider: WalletBalanceProvider(payable(report.walletBalanceProvider)),
Expand Down
1 change: 0 additions & 1 deletion src/deployments/contracts/utilities/MetadataReporter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ contract MetadataReporter is IMetadataReporter {
);
vm.serializeAddress(jsonReport, 'aaveOracle', report.aaveOracle);
vm.serializeAddress(jsonReport, 'treasury', report.treasury);
vm.serializeAddress(jsonReport, 'proxyAdmin', report.proxyAdmin);
vm.serializeAddress(jsonReport, 'wrappedTokenGateway', report.wrappedTokenGateway);
vm.serializeAddress(jsonReport, 'walletBalanceProvider', report.walletBalanceProvider);
vm.serializeAddress(jsonReport, 'uiIncentiveDataProvider', report.uiIncentiveDataProvider);
Expand Down
2 changes: 1 addition & 1 deletion src/deployments/interfaces/IErrors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ interface IErrors {
error L2MustBeEnabled();
error L2MustBeDisabled();
error ProviderNotFound();
error ProxyAdminNotFound();
error PoolAdminNotFound();
}
5 changes: 0 additions & 5 deletions src/deployments/interfaces/IMarketReportTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import '../../contracts/extensions/paraswap-adapters/ParaSwapWithdrawSwapAdapter
import '../../contracts/helpers/interfaces/IWrappedTokenGatewayV3.sol';
import '../../contracts/helpers/L2Encoder.sol';
import {ICollector} from '../../contracts/treasury/ICollector.sol';
import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol';

struct ContractsReport {
IPoolAddressesProviderRegistry poolAddressesProviderRegistry;
Expand All @@ -36,7 +35,6 @@ struct ContractsReport {
IACLManager aclManager;
ICollector treasury;
IDefaultInterestRateStrategyV2 defaultInterestRateStrategy;
ProxyAdmin proxyAdmin;
ICollector treasuryImplementation;
IWrappedTokenGatewayV3 wrappedTokenGateway;
WalletBalanceProvider walletBalanceProvider;
Expand Down Expand Up @@ -66,7 +64,6 @@ struct MarketReport {
address priceOracleSentinel;
address aclManager;
address treasury;
address proxyAdmin;
address treasuryImplementation;
address wrappedTokenGateway;
address walletBalanceProvider;
Expand Down Expand Up @@ -117,7 +114,6 @@ struct MarketConfig {
uint256 providerId;
bytes32 salt;
address wrappedNativeToken;
address proxyAdmin;
uint128 flashLoanPremiumTotal;
uint128 flashLoanPremiumToProtocol;
address incentivesProxy;
Expand Down Expand Up @@ -172,7 +168,6 @@ struct SetupReport {

struct PeripheryReport {
address aaveOracle;
address proxyAdmin;
address treasury;
address treasuryImplementation;
address emissionManager;
Expand Down
Loading

0 comments on commit 4ac35e5

Please sign in to comment.