Skip to content

Commit 1e863be

Browse files
author
0xSachinK
committed
Design Improvements: Spelling and grammar
1 parent cd15170 commit 1e863be

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

contracts/protocol/lib/PositionV2.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { PreciseUnitMath } from "../../lib/PreciseUnitMath.sol";
3737
* CHANGELOG:
3838
* - `Position` library has all internal functions which are inlined to the module contract during compilation.
3939
* Inlining functions increases bytecode size of the module contract. This library contains the same functions
40-
* as `Position` library but all the functions have public/external access modifier. Thus, making this version
40+
* as `Position` library but all the functions have public/external access modifier. Thus, making this version
4141
* linkable which helps in reducing bytecode size of the module contract.
4242
*/
4343
library PositionV2 {
@@ -62,7 +62,7 @@ library PositionV2 {
6262
function hasExternalPosition(ISetToken _setToken, address _component) public view returns(bool) {
6363
return _setToken.getExternalPositionModules(_component).length > 0;
6464
}
65-
65+
6666
/**
6767
* Returns whether the SetToken component default position real unit is greater than or equal to units passed in.
6868
*/
@@ -71,7 +71,7 @@ library PositionV2 {
7171
}
7272

7373
/**
74-
* Returns whether the SetToken component external position is greater than or equal to the real units passed in.
74+
* Returns whether the SetToken component's external position is greater than or equal to the real units passed in.
7575
*/
7676
function hasSufficientExternalUnits(
7777
ISetToken _setToken,
@@ -83,12 +83,12 @@ library PositionV2 {
8383
view
8484
returns(bool)
8585
{
86-
return _setToken.getExternalPositionRealUnit(_component, _positionModule) >= _unit.toInt256();
86+
return _setToken.getExternalPositionRealUnit(_component, _positionModule) >= _unit.toInt256();
8787
}
8888

8989
/**
9090
* If the position does not exist, create a new Position and add to the SetToken. If it already exists,
91-
* then set the position units. If the new units is 0, remove the position. Handles adding/removing of
91+
* then set the position units. If the new units is 0, remove the position. Handles adding/removing of
9292
* components where needed (in light of potential external positions).
9393
*
9494
* @param _setToken Address of SetToken being modified
@@ -114,7 +114,7 @@ library PositionV2 {
114114

115115
/**
116116
* Update an external position and remove and external positions or components if necessary. The logic flows as follows:
117-
* 1) If component is not already added then add component and external position.
117+
* 1) If component is not already added then add component and external position.
118118
* 2) If component is added but no existing external position using the passed module exists then add the external position.
119119
* 3) If the existing position is being added to then just update the unit and data
120120
* 4) If the position is being closed and no other external positions or default positions are associated with the component
@@ -191,7 +191,7 @@ library PositionV2 {
191191
* @return Notional tracked balance
192192
*/
193193
function getDefaultTrackedBalance(ISetToken _setToken, address _component) external view returns(uint256) {
194-
int256 positionUnit = _setToken.getDefaultPositionRealUnit(_component);
194+
int256 positionUnit = _setToken.getDefaultPositionRealUnit(_component);
195195
return _setToken.totalSupply().preciseMul(positionUnit.toUint256());
196196
}
197197

contracts/protocol/modules/v2/PerpV2BasisTradingModule.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ contract PerpV2BasisTradingModule is PerpV2LeverageModuleV2 {
130130
/* ============ External Functions ============ */
131131

132132
/**
133-
* @dev Reverts upon calling. Use `intialize(_setToken, _settings)` instead.
133+
* @dev Reverts upon calling. Use `initialize(_setToken, _settings)` instead.
134134
*/
135135
function initialize(ISetToken /*_setToken*/) public override(PerpV2LeverageModuleV2) {
136-
revert("Use intialize(_setToken, _settings) instead");
136+
revert("Use initialize(_setToken, _settings) instead");
137137
}
138138

139139
/**
@@ -232,7 +232,7 @@ contract PerpV2BasisTradingModule is PerpV2LeverageModuleV2 {
232232
/**
233233
* @dev SETTOKEN ONLY: Removes this module from the SetToken, via call by the SetToken. Deletes
234234
* position mappings and fee states associated with SetToken. Resets settled funding to zero.
235-
* Fees are not accrued in case reason for removing module is related to fee accrual.
235+
* Fees are not accrued in case the reason for removing the module is related to fee accrual.
236236
*
237237
* NOTE: Function will revert if there is greater than a position unit amount of USDC of account value.
238238
*/
@@ -463,7 +463,7 @@ contract PerpV2BasisTradingModule is PerpV2LeverageModuleV2 {
463463
}
464464

465465
/**
466-
* @dev Calculates manager and protocol fees on withdranwn funding amount and transfers them to
466+
* @dev Calculates manager and protocol fees on withdrawn funding amount and transfers them to
467467
* their respective recipients (in USDC).
468468
*
469469
* @param _setToken Instance of SetToken

contracts/protocol/modules/v2/PerpV2LeverageModuleV2.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ contract PerpV2LeverageModuleV2 is ModuleBaseV2, ReentrancyGuard, Ownable, SetTo
555555
/**
556556
* @dev GOVERNANCE ONLY: Update max perpetual positions per SetToken. Only callable by governance.
557557
*
558-
* @param _maxPerpPositionsPerSet New max perpetual positons per set
558+
* @param _maxPerpPositionsPerSet New max perpetual positions per set
559559
*/
560560
function updateMaxPerpPositionsPerSet(uint256 _maxPerpPositionsPerSet) external onlyOwner {
561561
maxPerpPositionsPerSet = _maxPerpPositionsPerSet;
@@ -1107,7 +1107,7 @@ contract PerpV2LeverageModuleV2 is ModuleBaseV2, ReentrancyGuard, Ownable, SetTo
11071107
* @param _setToken Instance of the SetToken
11081108
* @param _newExternalPositionUnit Dynamically calculated externalPositionUnit
11091109
* @return int256[] Components-length array with equity adjustment value at appropriate index
1110-
* @return int256[] Components-length array of zeroes (debt adjustements)
1110+
* @return int256[] Components-length array of zeroes (debt adjustments)
11111111
*/
11121112
function _formatAdjustments(
11131113
ISetToken _setToken,

deprecated/PerpV2LeverageModule.sol

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ contract PerpV2LeverageModule is ModuleBase, ReentrancyGuard, Ownable, SetTokenA
271271
* token market prices and needs to be generated on the fly to be meaningful.
272272
*
273273
* In the tables below, basePositionUnit = baseTokenBalance / setTotalSupply.
274-
*
274+
*
275275
* As a user when levering, e.g increasing the magnitude of your position, you'd trade as below
276276
* | ----------------------------------------------------------------------------------------------- |
277277
* | Type | Action | Goal | `quoteBoundQuantity` | `baseQuantityUnits` |
@@ -318,7 +318,7 @@ contract PerpV2LeverageModule is ModuleBase, ReentrancyGuard, Ownable, SetTokenA
318318
public
319319
nonReentrant
320320
onlyManagerAndValidSet(_setToken)
321-
{
321+
{
322322
ActionInfo memory actionInfo = _createAndValidateActionInfo(
323323
_setToken,
324324
_baseToken,
@@ -413,7 +413,7 @@ contract PerpV2LeverageModule is ModuleBase, ReentrancyGuard, Ownable, SetTokenA
413413
// `positions[setToken]` mapping stores an array of addresses. The base token addresses are removed from the array when the
414414
// corresponding base token positions are zeroed out. Since no positions exist when removing the module, the stored array should
415415
// already be empty, and the mapping can be deleted directly.
416-
delete positions[setToken];
416+
delete positions[setToken];
417417

418418
// Try if unregister exists on any of the modules
419419
address[] memory modules = setToken.getModules();
@@ -563,8 +563,8 @@ contract PerpV2LeverageModule is ModuleBase, ReentrancyGuard, Ownable, SetTokenA
563563

564564
/**
565565
* @dev GOVERNANCE ONLY: Update max perpetual positions per SetToken. Only callable by governance.
566-
*
567-
* @param _maxPerpPositionsPerSet New max perpetual positons per set
566+
*
567+
* @param _maxPerpPositionsPerSet New max perpetual positions per set
568568
*/
569569
function updateMaxPerpPositionsPerSet(uint256 _maxPerpPositionsPerSet) external onlyOwner {
570570
maxPerpPositionsPerSet = _maxPerpPositionsPerSet;
@@ -1052,8 +1052,8 @@ contract PerpV2LeverageModule is ModuleBase, ReentrancyGuard, Ownable, SetTokenA
10521052

10531053
int256 baseBalance = perpAccountBalance.getBase(address(_setToken), _baseToken);
10541054
int256 basePositionUnit = baseBalance.preciseDiv(totalSupply.toInt256());
1055-
1056-
int256 baseNotional = _baseQuantityUnits == basePositionUnit.neg()
1055+
1056+
int256 baseNotional = _baseQuantityUnits == basePositionUnit.neg()
10571057
? baseBalance.neg() // To close position completely
10581058
: _baseQuantityUnits.preciseMul(totalSupply.toInt256());
10591059

@@ -1134,7 +1134,7 @@ contract PerpV2LeverageModule is ModuleBase, ReentrancyGuard, Ownable, SetTokenA
11341134
function _syncPositionList(ISetToken _setToken) internal {
11351135
address[] memory positionList = positions[_setToken];
11361136
uint256 positionLength = positionList.length;
1137-
1137+
11381138
for (uint256 i = 0; i < positionLength; i++) {
11391139
address currPosition = positionList[i];
11401140
if (!_hasBaseBalance(_setToken, currPosition)) {
@@ -1236,7 +1236,7 @@ contract PerpV2LeverageModule is ModuleBase, ReentrancyGuard, Ownable, SetTokenA
12361236
* @param _components Array of components held by the SetToken
12371237
* @param _newExternalPositionUnit Dynamically calculated externalPositionUnit
12381238
* @return int256[] Components-length array with equity adjustment value at appropriate index
1239-
* @return int256[] Components-length array of zeroes (debt adjustements)
1239+
* @return int256[] Components-length array of zeroes (debt adjustments)
12401240
*/
12411241
function _formatAdjustments(
12421242
ISetToken _setToken,

0 commit comments

Comments
 (0)