@@ -100,7 +100,7 @@ contract ERC721StakingModule is IStakingModule {
100100 require (amount <= _token.balanceOf (user), "smn3 " );
101101 require (data.length == 32 * amount, "smn4 " );
102102
103- uint256 sz = counts[user];
103+ uint256 count = counts[user];
104104
105105 // stake
106106 for (uint256 i = 0 ; i < amount; i++ ) {
@@ -113,7 +113,7 @@ contract ERC721StakingModule is IStakingModule {
113113
114114 // ownership mappings
115115 owners[id] = user;
116- uint256 len = sz + i;
116+ uint256 len = count + i;
117117 tokenByOwner[user][len] = id;
118118 tokenIndex[id] = len;
119119
@@ -122,13 +122,13 @@ contract ERC721StakingModule is IStakingModule {
122122 }
123123
124124 // update position
125- counts[user] = sz + amount;
125+ counts[user] = count + amount;
126126
127127 // emit
128- uint256 s = amount * SHARES_PER_TOKEN;
129- emit Staked (user, address (_token), amount, s );
128+ uint256 shares = amount * SHARES_PER_TOKEN;
129+ emit Staked (user, address (_token), amount, shares );
130130
131- return (user, s );
131+ return (user, shares );
132132 }
133133
134134 /**
@@ -141,8 +141,8 @@ contract ERC721StakingModule is IStakingModule {
141141 ) external override onlyOwner returns (address , uint256 ) {
142142 // validate
143143 require (amount > 0 , "smn5 " );
144- uint256 sz = counts[user];
145- require (amount <= sz , "smn6 " );
144+ uint256 count = counts[user];
145+ require (amount <= count , "smn6 " );
146146 require (data.length == 32 * amount, "smn7 " );
147147
148148 // unstake
@@ -159,8 +159,8 @@ contract ERC721StakingModule is IStakingModule {
159159 delete owners[id];
160160
161161 // clean up ownership mappings
162- uint256 lastIndex = sz - 1 - i;
163- if (amount != sz ) {
162+ uint256 lastIndex = count - 1 - i;
163+ if (amount != count ) {
164164 // reindex on partial unstake
165165 uint256 index = tokenIndex[id];
166166 if (index != lastIndex) {
@@ -177,13 +177,13 @@ contract ERC721StakingModule is IStakingModule {
177177 }
178178
179179 // update position
180- counts[user] = sz - amount;
180+ counts[user] = count - amount;
181181
182182 // emit
183- uint256 s = amount * SHARES_PER_TOKEN;
184- emit Unstaked (user, address (_token), amount, s );
183+ uint256 shares = amount * SHARES_PER_TOKEN;
184+ emit Unstaked (user, address (_token), amount, shares );
185185
186- return (user, s );
186+ return (user, shares );
187187 }
188188
189189 /**
@@ -198,9 +198,9 @@ contract ERC721StakingModule is IStakingModule {
198198 require (amount > 0 , "smn9 " );
199199 require (amount <= counts[user], "smn10 " );
200200
201- uint256 s = amount * SHARES_PER_TOKEN;
202- emit Claimed (user, address (_token), amount, s );
203- return (user, s );
201+ uint256 shares = amount * SHARES_PER_TOKEN;
202+ emit Claimed (user, address (_token), amount, shares );
203+ return (user, shares );
204204 }
205205
206206 /**
0 commit comments