Skip to content

Commit 2c330f8

Browse files
authored
Merge pull request #107 from opynfinance/get-vault-owners-list
Get vault owners list
2 parents 0742880 + b8a2ae7 commit 2c330f8

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

contracts/OptionsContract.sol

+4-13
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ contract OptionsContract is Ownable, ERC20 {
3838

3939
mapping(address => Vault) internal vaults;
4040

41-
address payable[] internal vaultOwners;
41+
address payable[] public vaultOwners;
4242

4343
// 10 is 0.01 i.e. 1% incentive.
4444
Number public liquidationIncentive = Number(10, -3);
@@ -221,19 +221,10 @@ contract OptionsContract is Ownable, ERC20 {
221221
}
222222

223223
/**
224-
* @notice This function gets the array of vaultOwners
224+
* @notice This function gets the length of vaultOwners array
225225
*/
226-
function getVaultOwners() public view returns (address payable[] memory) {
227-
address payable[] memory owners;
228-
uint256 index = 0;
229-
for (uint256 i = 0; i < vaultOwners.length; i++) {
230-
if (hasVault(vaultOwners[i])) {
231-
owners[index] = vaultOwners[i];
232-
index++;
233-
}
234-
}
235-
236-
return owners;
226+
function getVaultOwnersLength() public view returns (uint256) {
227+
return vaultOwners.length;
237228
}
238229

239230
/**

0 commit comments

Comments
 (0)