@@ -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