Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diffs: zksync #22

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
4 changes: 4 additions & 0 deletions diffs/GNOSIS_ZKSYNC/AAVE_PROTOCOL_DATA_PROVIDER_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```diff
diff --git a/./downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER.sol b/./downloads/ZKSYNC/AAVE_PROTOCOL_DATA_PROVIDER.sol

```
4 changes: 4 additions & 0 deletions diffs/GNOSIS_ZKSYNC/ACL_MANAGER_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```diff
diff --git a/./downloads/GNOSIS/ACL_MANAGER.sol b/./downloads/ZKSYNC/ACL_MANAGER.sol

```
4 changes: 4 additions & 0 deletions diffs/GNOSIS_ZKSYNC/BORROW_LOGIC_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```diff
diff --git a/./downloads/GNOSIS/BORROW_LOGIC.sol b/./downloads/ZKSYNC/BORROW_LOGIC.sol

```
4 changes: 4 additions & 0 deletions diffs/GNOSIS_ZKSYNC/BRIDGE_LOGIC_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```diff
diff --git a/./downloads/GNOSIS/BRIDGE_LOGIC.sol b/./downloads/ZKSYNC/BRIDGE_LOGIC.sol

```
28 changes: 28 additions & 0 deletions diffs/GNOSIS_ZKSYNC/COLLECTOR_IMPL_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
```diff
diff --git a/./downloads/GNOSIS/COLLECTOR_IMPL.sol b/./downloads/ZKSYNC/COLLECTOR_IMPL.sol

-// downloads/GNOSIS/COLLECTOR_IMPL/Collector/lib/aave-collector-unification/src/contracts/Collector.sol
+// downloads/ZKSYNC/COLLECTOR_IMPL/Collector/src/periphery/contracts/treasury/Collector.sol

/**
* @title Collector
@@ -903,8 +782,6 @@ contract Collector is VersionedInitializable, ICollector, ReentrancyGuard {
_nextStreamId = nextStreamId;
}

- // can be removed after first deployment
- _initGuard();
_setFundsAdmin(fundsAdmin);
}

@@ -1021,9 +898,6 @@ contract Collector is VersionedInitializable, ICollector, ReentrancyGuard {
}
}

- /// @dev needed in order to receive ETH from the Aave v1 ecosystem reserve
- receive() external payable {}
-
/// @inheritdoc ICollector
function setFundsAdmin(address admin) external onlyFundsAdmin {
_setFundsAdmin(admin);
```
4 changes: 4 additions & 0 deletions diffs/GNOSIS_ZKSYNC/CONFIGURATOR_LOGIC_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```diff
diff --git a/./downloads/GNOSIS/CONFIGURATOR_LOGIC.sol b/./downloads/ZKSYNC/CONFIGURATOR_LOGIC.sol

```
4 changes: 4 additions & 0 deletions diffs/GNOSIS_ZKSYNC/CONFIG_ENGINE_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```diff
diff --git a/./downloads/GNOSIS/CONFIG_ENGINE.sol b/./downloads/ZKSYNC/CONFIG_ENGINE.sol

```
148 changes: 148 additions & 0 deletions diffs/GNOSIS_ZKSYNC/DEFAULT_A_TOKEN_IMPL_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
```diff
diff --git a/./downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL.sol b/./downloads/ZKSYNC/DEFAULT_A_TOKEN_IMPL.sol

-// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/tokenization/base/IncentivizedERC20.sol
+// downloads/ZKSYNC/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/core/contracts/protocol/tokenization/base/IncentivizedERC20.sol

/**
* @title IncentivizedERC20
@@ -2588,15 +2738,15 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed {
/**
* @dev Constructor.
* @param pool The reference to the main Pool contract
- * @param name The name of the token
- * @param symbol The symbol of the token
- * @param decimals The number of decimals of the token
+ * @param name_ The name of the token
+ * @param symbol_ The symbol of the token
+ * @param decimals_ The number of decimals of the token
*/
- constructor(IPool pool, string memory name, string memory symbol, uint8 decimals) {
+ constructor(IPool pool, string memory name_, string memory symbol_, uint8 decimals_) {
_addressesProvider = pool.ADDRESSES_PROVIDER();
- _name = name;
- _symbol = symbol;
- _decimals = decimals;
+ _name = name_;
+ _symbol = symbol_;
+ _decimals = decimals_;
POOL = pool;
}

@@ -2757,7 +2907,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed {
}
}

-// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/tokenization/AToken.sol
+// downloads/ZKSYNC/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/core/contracts/protocol/tokenization/AToken.sol

/**
* @title Aave ERC20 AToken
* @author Aave
* @notice Implementation of the interest bearing token for the Aave protocol
*/
-contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, IAToken {
+abstract contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, IAToken {
using WadRayMath for uint256;
using SafeCast for uint256;
using GPv2SafeERC20 for IERC20;
@@ -2983,16 +3133,9 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I
bytes32 public constant PERMIT_TYPEHASH =
keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)');

- uint256 public constant ATOKEN_REVISION = 0x1;
-
address internal _treasury;
address internal _underlyingAsset;

- /// @inheritdoc VersionedInitializable
- function getRevision() internal pure virtual override returns (uint256) {
- return ATOKEN_REVISION;
- }
-
/**
* @dev Constructor.
* @param pool The address of the Pool contract
@@ -3013,29 +3156,7 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I
string calldata aTokenName,
string calldata aTokenSymbol,
bytes calldata params
- ) public virtual override initializer {
- require(initializingPool == POOL, Errors.POOL_ADDRESSES_DO_NOT_MATCH);
- _setName(aTokenName);
- _setSymbol(aTokenSymbol);
- _setDecimals(aTokenDecimals);
-
- _treasury = treasury;
- _underlyingAsset = underlyingAsset;
- _incentivesController = incentivesController;
-
- _domainSeparator = _calculateDomainSeparator();
-
- emit Initialized(
- underlyingAsset,
- address(POOL),
- treasury,
- address(incentivesController),
- aTokenDecimals,
- aTokenName,
- aTokenSymbol,
- params
- );
- }
+ ) public virtual;

/// @inheritdoc IAToken
function mint(
@@ -3209,3 +3330,50 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I
IERC20(token).safeTransfer(to, amount);
}
}
+
+// downloads/ZKSYNC/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/core/instances/ATokenInstance.sol
+
+contract ATokenInstance is AToken {
+ uint256 public constant ATOKEN_REVISION = 1;
+
+ constructor(IPool pool) AToken(pool) {}
+
+ /// @inheritdoc VersionedInitializable
+ function getRevision() internal pure virtual override returns (uint256) {
+ return ATOKEN_REVISION;
+ }
+
+ /// @inheritdoc IInitializableAToken
+ function initialize(
+ IPool initializingPool,
+ address treasury,
+ address underlyingAsset,
+ IAaveIncentivesController incentivesController,
+ uint8 aTokenDecimals,
+ string calldata aTokenName,
+ string calldata aTokenSymbol,
+ bytes calldata params
+ ) public virtual override initializer {
+ require(initializingPool == POOL, Errors.POOL_ADDRESSES_DO_NOT_MATCH);
+ _setName(aTokenName);
+ _setSymbol(aTokenSymbol);
+ _setDecimals(aTokenDecimals);
+
+ _treasury = treasury;
+ _underlyingAsset = underlyingAsset;
+ _incentivesController = incentivesController;
+
+ _domainSeparator = _calculateDomainSeparator();
+
+ emit Initialized(
+ underlyingAsset,
+ address(POOL),
+ treasury,
+ address(incentivesController),
+ aTokenDecimals,
+ aTokenName,
+ aTokenSymbol,
+ params
+ );
+ }
+}
```
30 changes: 30 additions & 0 deletions diffs/GNOSIS_ZKSYNC/DEFAULT_INCENTIVES_CONTROLLER_IMPL_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
```diff
diff --git a/./downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL.sol b/./downloads/ZKSYNC/DEFAULT_INCENTIVES_CONTROLLER_IMPL.sol

-// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/periphery/contracts/rewards/RewardsDistributor.sol
+// downloads/ZKSYNC/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/periphery/contracts/rewards/RewardsDistributor.sol

/**
* @title RewardsDistributor
@@ -1015,7 +1015,7 @@ abstract contract RewardsDistributor is IRewardsDistributor {
function getRewardsData(
address asset,
address reward
- ) public view override returns (uint256, uint256, uint256, uint256) {
+ ) external view override returns (uint256, uint256, uint256, uint256) {
return (
_assets[asset].rewards[reward].index,
_assets[asset].rewards[reward].emissionPerSecond,
@@ -1067,7 +1067,7 @@ abstract contract RewardsDistributor is IRewardsDistributor {
address user,
address asset,
address reward
- ) public view override returns (uint256) {
+ ) external view override returns (uint256) {
return _assets[asset].rewards[reward].usersData[user].index;
}

@@ -1506,7 +1506,7 @@ abstract contract RewardsDistributor is IRewardsDistributor {
}
}
```
Loading
Loading