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

chore: zksync diffs #10

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ out/

# artifacts
reports/
diffs/
downloads/

# editors
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${a
git-diff :
@mkdir -p diffs
@printf '%s\n%s\n%s\n' "\`\`\`diff" "$$(git diff --no-index --diff-algorithm=patience --ignore-space-at-eol ${before} ${after})" "\`\`\`" > diffs/${out}.md

7 changes: 7 additions & 0 deletions diffs/MAINNET_ZKSYNC/AAVE_PROTOCOL_DATA_PROVIDER_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```diff
diff --git a/./downloads/MAINNET/AAVE_PROTOCOL_DATA_PROVIDER.sol b/./downloads/ZKSYNC/AAVE_PROTOCOL_DATA_PROVIDER.sol
index 91cc016..35ccb13 100644
--- a/./downloads/MAINNET/AAVE_PROTOCOL_DATA_PROVIDER.sol
+++ b/./downloads/ZKSYNC/AAVE_PROTOCOL_DATA_PROVIDER.sol

```
7 changes: 7 additions & 0 deletions diffs/MAINNET_ZKSYNC/ACL_MANAGER_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```diff
diff --git a/./downloads/MAINNET/ACL_MANAGER.sol b/./downloads/ZKSYNC/ACL_MANAGER.sol
index 8e5aac3..88e1973 100644
--- a/./downloads/MAINNET/ACL_MANAGER.sol
+++ b/./downloads/ZKSYNC/ACL_MANAGER.sol

```
7 changes: 7 additions & 0 deletions diffs/MAINNET_ZKSYNC/BORROW_LOGIC_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```diff
diff --git a/./downloads/MAINNET/BORROW_LOGIC.sol b/./downloads/ZKSYNC/BORROW_LOGIC.sol
index 1a60f5e..d61106e 100644
--- a/./downloads/MAINNET/BORROW_LOGIC.sol
+++ b/./downloads/ZKSYNC/BORROW_LOGIC.sol

```
7 changes: 7 additions & 0 deletions diffs/MAINNET_ZKSYNC/BRIDGE_LOGIC_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```diff
diff --git a/./downloads/MAINNET/BRIDGE_LOGIC.sol b/./downloads/ZKSYNC/BRIDGE_LOGIC.sol
index af3d37e..202afd6 100644
--- a/./downloads/MAINNET/BRIDGE_LOGIC.sol
+++ b/./downloads/ZKSYNC/BRIDGE_LOGIC.sol

```
31 changes: 31 additions & 0 deletions diffs/MAINNET_ZKSYNC/COLLECTOR_IMPL_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
```diff
diff --git a/./downloads/MAINNET/COLLECTOR_IMPL.sol b/./downloads/ZKSYNC/COLLECTOR_IMPL.sol
index 63ccda0..e453c1f 100644
--- a/./downloads/MAINNET/COLLECTOR_IMPL.sol
+++ b/./downloads/ZKSYNC/COLLECTOR_IMPL.sol

-// downloads/MAINNET/COLLECTOR_IMPL/Collector/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);
```
7 changes: 7 additions & 0 deletions diffs/MAINNET_ZKSYNC/CONFIGURATOR_LOGIC_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```diff
diff --git a/./downloads/MAINNET/CONFIGURATOR_LOGIC.sol b/./downloads/ZKSYNC/CONFIGURATOR_LOGIC.sol
index 54ee17a..70934b0 100644
--- a/./downloads/MAINNET/CONFIGURATOR_LOGIC.sol
+++ b/./downloads/ZKSYNC/CONFIGURATOR_LOGIC.sol

```
151 changes: 151 additions & 0 deletions diffs/MAINNET_ZKSYNC/DEFAULT_A_TOKEN_IMPL_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
```diff
diff --git a/./downloads/MAINNET/DEFAULT_A_TOKEN_IMPL.sol b/./downloads/ZKSYNC/DEFAULT_A_TOKEN_IMPL.sol
index 36ee10c..459d34e 100644
--- a/./downloads/MAINNET/DEFAULT_A_TOKEN_IMPL.sol
+++ b/./downloads/ZKSYNC/DEFAULT_A_TOKEN_IMPL.sol

-// downloads/MAINNET/DEFAULT_A_TOKEN_IMPL/AToken/@aave/core-v3/contracts/protocol/tokenization/base/IncentivizedERC20.sol
+// downloads/ZKSYNC/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/core/contracts/protocol/tokenization/base/IncentivizedERC20.sol

/**
* @title IncentivizedERC20
@@ -2587,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;
}

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

-// downloads/MAINNET/DEFAULT_A_TOKEN_IMPL/AToken/@aave/core-v3/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;
@@ -2982,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
@@ -3012,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(
@@ -3208,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
+ );
+ }
+}
```
34 changes: 34 additions & 0 deletions diffs/MAINNET_ZKSYNC/DEFAULT_INCENTIVES_CONTROLLER_IMPL_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
```diff
diff --git a/./downloads/MAINNET/DEFAULT_INCENTIVES_CONTROLLER_IMPL.sol b/./downloads/ZKSYNC/DEFAULT_INCENTIVES_CONTROLLER_IMPL.sol
index e94b837..455ec9b 100644
--- a/./downloads/MAINNET/DEFAULT_INCENTIVES_CONTROLLER_IMPL.sol
+++ b/./downloads/ZKSYNC/DEFAULT_INCENTIVES_CONTROLLER_IMPL.sol

-// downloads/MAINNET/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/@aave/periphery-v3/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