@@ -48,12 +48,12 @@ pragma solidity >=0.8.18;
48
48
* $$$$$$$$$$$$$$$$$$$$$$$$$%zt-+>iiiiiiiiiiiiiiiiiiiiiiiiiiiii+_tc%$$$$$$$$$$$$$$$$$$$$$$$$$
49
49
* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$W#u/|{+~>iiiiiiiiiiii><+{|/n#W$$$$$$$$$$$$$$$$$$$$$$$$$$$$
50
50
*/
51
- import {Math} from "@ openzeppelin/contracts/utils/math/Math.sol " ;
52
- import {ERC20 } from "@ openzeppelin/contracts/token/ERC20/ERC20.sol " ;
53
- import {SafeERC20} from "@ openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol " ;
51
+ import { Math } from "openzeppelin/contracts/utils/math/Math.sol " ;
52
+ import { ERC20 } from "openzeppelin/contracts/token/ERC20/ERC20.sol " ;
53
+ import { SafeERC20 } from "openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol " ;
54
54
55
- import {IFactory} from "tokenized-strategy/interfaces/IFactory.sol " ;
56
- import {IBaseStrategy} from "tokenized-strategy/interfaces/IBaseStrategy.sol " ;
55
+ import { IFactory } from "tokenized-strategy/interfaces/IFactory.sol " ;
56
+ import { IBaseStrategy } from "tokenized-strategy/interfaces/IBaseStrategy.sol " ;
57
57
58
58
/**
59
59
* @title Yearn Tokenized Strategy
@@ -193,7 +193,8 @@ contract TokenizedStrategy {
193
193
bytes32 INITIAL_DOMAIN_SEPARATOR; // The domain separator used for permits on the initial chain.
194
194
mapping (address => uint256 ) nonces; // Mapping of nonces used for permit functions.
195
195
mapping (address => uint256 ) balances; // Mapping to track current balances for each account that holds shares.
196
- mapping (address => mapping (address => uint256 )) allowances; // Mapping to track the allowances for the strategies shares.
196
+ mapping (address => mapping (address => uint256 )) allowances; // Mapping to track the allowances for the
197
+ // strategies shares.
197
198
// We manually track `totalAssets` to prevent PPS manipulation through airdrops.
198
199
uint256 totalAssets;
199
200
// Variables for profit reporting and locking.
@@ -318,7 +319,7 @@ contract TokenizedStrategy {
318
319
uint8 internal constant NOT_ENTERED = 1 ;
319
320
320
321
/// @notice Maximum in Basis Points the Performance Fee can be set to.
321
- uint16 public constant MAX_FEE = 5_000 ; // 50%
322
+ uint16 public constant MAX_FEE = 5000 ; // 50%
322
323
323
324
/// @notice Used for fee calculations.
324
325
uint256 internal constant MAX_BPS = 10_000 ;
@@ -402,7 +403,9 @@ contract TokenizedStrategy {
402
403
address _management ,
403
404
address _performanceFeeRecipient ,
404
405
address _keeper
405
- ) external {
406
+ )
407
+ external
408
+ {
406
409
// Cache storage pointer.
407
410
StrategyData storage S = _strategyStorage ();
408
411
@@ -508,7 +511,12 @@ contract TokenizedStrategy {
508
511
* @param maxLoss The amount of acceptable loss in Basis points.
509
512
* @return shares The actual amount of shares burnt.
510
513
*/
511
- function withdraw (uint256 assets , address receiver , address owner , uint256 maxLoss )
514
+ function withdraw (
515
+ uint256 assets ,
516
+ address receiver ,
517
+ address owner ,
518
+ uint256 maxLoss
519
+ )
512
520
public
513
521
nonReentrant
514
522
returns (uint256 shares )
@@ -547,7 +555,12 @@ contract TokenizedStrategy {
547
555
* @param maxLoss The amount of acceptable loss in Basis points.
548
556
* @return . The actual amount of underlying withdrawn.
549
557
*/
550
- function redeem (uint256 shares , address receiver , address owner , uint256 maxLoss )
558
+ function redeem (
559
+ uint256 shares ,
560
+ address receiver ,
561
+ address owner ,
562
+ uint256 maxLoss
563
+ )
551
564
public
552
565
nonReentrant
553
566
returns (uint256 )
@@ -735,7 +748,11 @@ contract TokenizedStrategy {
735
748
}
736
749
737
750
/// @dev Internal implementation of {convertToShares}.
738
- function _convertToShares (StrategyData storage S , uint256 assets , Math.Rounding _rounding )
751
+ function _convertToShares (
752
+ StrategyData storage S ,
753
+ uint256 assets ,
754
+ Math.Rounding _rounding
755
+ )
739
756
internal
740
757
view
741
758
returns (uint256 )
@@ -751,7 +768,11 @@ contract TokenizedStrategy {
751
768
}
752
769
753
770
/// @dev Internal implementation of {convertToAssets}.
754
- function _convertToAssets (StrategyData storage S , uint256 shares , Math.Rounding _rounding )
771
+ function _convertToAssets (
772
+ StrategyData storage S ,
773
+ uint256 shares ,
774
+ Math.Rounding _rounding
775
+ )
755
776
internal
756
777
view
757
778
returns (uint256 )
@@ -863,7 +884,10 @@ contract TokenizedStrategy {
863
884
uint256 assets ,
864
885
uint256 shares ,
865
886
uint256 maxLoss
866
- ) internal returns (uint256 ) {
887
+ )
888
+ internal
889
+ returns (uint256 )
890
+ {
867
891
require (receiver != address (0 ), "ZERO ADDRESS " );
868
892
require (maxLoss <= MAX_BPS, "exceeds MAX_BPS " );
869
893
@@ -1746,7 +1770,15 @@ contract TokenizedStrategy {
1746
1770
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
1747
1771
* section].
1748
1772
*/
1749
- function permit (address owner , address spender , uint256 value , uint256 deadline , uint8 v , bytes32 r , bytes32 s )
1773
+ function permit (
1774
+ address owner ,
1775
+ address spender ,
1776
+ uint256 value ,
1777
+ uint256 deadline ,
1778
+ uint8 v ,
1779
+ bytes32 r ,
1780
+ bytes32 s
1781
+ )
1750
1782
external
1751
1783
{
1752
1784
require (deadline >= block .timestamp , "ERC20: PERMIT_DEADLINE_EXPIRED " );
0 commit comments