Skip to content

Commit be2b6cc

Browse files
committed
Removed prettier changes
1 parent 226ec38 commit be2b6cc

File tree

2 files changed

+79
-42
lines changed
  • src
    • amm/AToken/AToken/contracts/protocol/tokenization
    • core/AToken/AToken/@aave/protocol-v2/contracts/protocol/tokenization

2 files changed

+79
-42
lines changed

src/amm/AToken/AToken/contracts/protocol/tokenization/AToken.sol

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ contract AToken is
4343
address internal _underlyingAsset;
4444
IAaveIncentivesController internal _incentivesController;
4545

46-
modifier onlyLendingPool() {
46+
modifier onlyLendingPool {
4747
require(_msgSender() == address(_pool), Errors.CT_CALLER_MUST_BE_LENDING_POOL);
4848
_;
4949
}
@@ -129,7 +129,7 @@ contract AToken is
129129
_burn(user, amountScaled);
130130

131131
uint256 releaseAmount = amount > RELEASE_MARGIN ? amount - RELEASE_MARGIN : 0;
132-
if (releaseAmount != 0) {
132+
if(releaseAmount != 0) {
133133
IERC20(_underlyingAsset).safeTransfer(receiverOfUnderlying, releaseAmount);
134134
}
135135

@@ -209,9 +209,12 @@ contract AToken is
209209
* @param user The user whose balance is calculated
210210
* @return The balance of the user
211211
**/
212-
function balanceOf(
213-
address user
214-
) public view override(IncentivizedERC20, IERC20) returns (uint256) {
212+
function balanceOf(address user)
213+
public
214+
view
215+
override(IncentivizedERC20, IERC20)
216+
returns (uint256)
217+
{
215218
return super.balanceOf(user).rayMul(_pool.getReserveNormalizedIncome(_underlyingAsset));
216219
}
217220

@@ -231,9 +234,12 @@ contract AToken is
231234
* @return The scaled balance of the user
232235
* @return The scaled balance and the scaled total supply
233236
**/
234-
function getScaledUserBalanceAndSupply(
235-
address user
236-
) external view override returns (uint256, uint256) {
237+
function getScaledUserBalanceAndSupply(address user)
238+
external
239+
view
240+
override
241+
returns (uint256, uint256)
242+
{
237243
return (super.balanceOf(user), super.totalSupply());
238244
}
239245

@@ -303,10 +309,12 @@ contract AToken is
303309
* @param amount The amount getting transferred
304310
* @return The amount transferred
305311
**/
306-
function transferUnderlyingTo(
307-
address target,
308-
uint256 amount
309-
) external override onlyLendingPool returns (uint256) {
312+
function transferUnderlyingTo(address target, uint256 amount)
313+
external
314+
override
315+
onlyLendingPool
316+
returns (uint256)
317+
{
310318
IERC20(_underlyingAsset).safeTransfer(target, amount);
311319
return amount;
312320
}
@@ -342,13 +350,14 @@ contract AToken is
342350
//solium-disable-next-line
343351
require(block.timestamp <= deadline, 'INVALID_EXPIRATION');
344352
uint256 currentValidNonce = _nonces[owner];
345-
bytes32 digest = keccak256(
346-
abi.encodePacked(
347-
'\x19\x01',
348-
DOMAIN_SEPARATOR,
349-
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, currentValidNonce, deadline))
350-
)
351-
);
353+
bytes32 digest =
354+
keccak256(
355+
abi.encodePacked(
356+
'\x19\x01',
357+
DOMAIN_SEPARATOR,
358+
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, currentValidNonce, deadline))
359+
)
360+
);
352361
require(owner == ecrecover(digest, v, r, s), 'INVALID_SIGNATURE');
353362
_nonces[owner] = currentValidNonce.add(1);
354363
_approve(owner, spender, value);
@@ -362,7 +371,12 @@ contract AToken is
362371
* @param amount The amount getting transferred
363372
* @param validate `true` if the transfer needs to be validated
364373
**/
365-
function _transfer(address from, address to, uint256 amount, bool validate) internal {
374+
function _transfer(
375+
address from,
376+
address to,
377+
uint256 amount,
378+
bool validate
379+
) internal {
366380
address underlyingAsset = _underlyingAsset;
367381
ILendingPool pool = _pool;
368382

@@ -386,7 +400,11 @@ contract AToken is
386400
* @param to The destination address
387401
* @param amount The amount getting transferred
388402
**/
389-
function _transfer(address from, address to, uint256 amount) internal override {
403+
function _transfer(
404+
address from,
405+
address to,
406+
uint256 amount
407+
) internal override {
390408
_transfer(from, to, amount, true);
391409
}
392410
}

src/core/AToken/AToken/@aave/protocol-v2/contracts/protocol/tokenization/AToken.sol

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
3737
/// @dev owner => next valid nonce to submit with permit()
3838
mapping(address => uint256) public _nonces;
3939

40+
4041
bytes32 public DOMAIN_SEPARATOR;
4142

42-
modifier onlyLendingPool() {
43+
modifier onlyLendingPool {
4344
require(_msgSender() == address(POOL), Errors.CT_CALLER_MUST_BE_LENDING_POOL);
4445
_;
4546
}
@@ -118,7 +119,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
118119
_burn(user, amountScaled);
119120

120121
uint256 releaseAmount = amount > RELEASE_MARGIN ? amount - RELEASE_MARGIN : 0;
121-
if (releaseAmount != 0) {
122+
if(releaseAmount != 0) {
122123
IERC20(UNDERLYING_ASSET_ADDRESS).safeTransfer(receiverOfUnderlying, releaseAmount);
123124
}
124125

@@ -196,9 +197,12 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
196197
* @param user The user whose balance is calculated
197198
* @return The balance of the user
198199
**/
199-
function balanceOf(
200-
address user
201-
) public view override(IncentivizedERC20, IERC20) returns (uint256) {
200+
function balanceOf(address user)
201+
public
202+
view
203+
override(IncentivizedERC20, IERC20)
204+
returns (uint256)
205+
{
202206
return super.balanceOf(user).rayMul(POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS));
203207
}
204208

@@ -218,9 +222,12 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
218222
* @return The scaled balance of the user
219223
* @return The scaled balance and the scaled total supply
220224
**/
221-
function getScaledUserBalanceAndSupply(
222-
address user
223-
) external view override returns (uint256, uint256) {
225+
function getScaledUserBalanceAndSupply(address user)
226+
external
227+
view
228+
override
229+
returns (uint256, uint256)
230+
{
224231
return (super.balanceOf(user), super.totalSupply());
225232
}
226233

@@ -262,10 +269,12 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
262269
* @param amount The amount getting transferred
263270
* @return The amount transferred
264271
**/
265-
function transferUnderlyingTo(
266-
address target,
267-
uint256 amount
268-
) external override onlyLendingPool returns (uint256) {
272+
function transferUnderlyingTo(address target, uint256 amount)
273+
external
274+
override
275+
onlyLendingPool
276+
returns (uint256)
277+
{
269278
IERC20(UNDERLYING_ASSET_ADDRESS).safeTransfer(target, amount);
270279
return amount;
271280
}
@@ -294,13 +303,14 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
294303
//solium-disable-next-line
295304
require(block.timestamp <= deadline, 'INVALID_EXPIRATION');
296305
uint256 currentValidNonce = _nonces[owner];
297-
bytes32 digest = keccak256(
298-
abi.encodePacked(
299-
'\x19\x01',
300-
DOMAIN_SEPARATOR,
301-
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, currentValidNonce, deadline))
302-
)
303-
);
306+
bytes32 digest =
307+
keccak256(
308+
abi.encodePacked(
309+
'\x19\x01',
310+
DOMAIN_SEPARATOR,
311+
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, currentValidNonce, deadline))
312+
)
313+
);
304314
require(owner == ecrecover(digest, v, r, s), 'INVALID_SIGNATURE');
305315
_nonces[owner] = currentValidNonce.add(1);
306316
_approve(owner, spender, value);
@@ -314,7 +324,12 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
314324
* @param amount The amount getting transferred
315325
* @param validate `true` if the transfer needs to be validated
316326
**/
317-
function _transfer(address from, address to, uint256 amount, bool validate) internal {
327+
function _transfer(
328+
address from,
329+
address to,
330+
uint256 amount,
331+
bool validate
332+
) internal {
318333
uint256 index = POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS);
319334

320335
uint256 fromBalanceBefore = super.balanceOf(from).rayMul(index);
@@ -342,7 +357,11 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
342357
* @param to The destination address
343358
* @param amount The amount getting transferred
344359
**/
345-
function _transfer(address from, address to, uint256 amount) internal override {
360+
function _transfer(
361+
address from,
362+
address to,
363+
uint256 amount
364+
) internal override {
346365
_transfer(from, to, amount, true);
347366
}
348367
}

0 commit comments

Comments
 (0)