contract BerezkaTokenAdapterStakingGovernance is Ownable() {

    using EnumerableSet for EnumerableSet.AddressSet;

    /// @dev This is a set of debt protocol adapters that return staked amount of ERC20 tokens
    EnumerableSet.AddressSet private stakings;

    constructor(address[] memory _stakings) public {
        _add(stakings, _stakings);
    }

    // Modification functions (all only by owner)

    function addStakings(address[] memory _stakings) public onlyOwner() {
        require(_stakings.length > 0, "Length should be > 0");

        _add(stakings, _stakings);
    }

    function removeStakings(address[] memory _stakings) public onlyOwner() {
        require(_stakings.length > 0, "Length should be > 0");

        _remove(stakings, _stakings);
    }

    // View functions

    function listStakings() external view returns (address[] memory) {
        return _list(stakings);
    }

    // Internal functions

    function _add(EnumerableSet.AddressSet storage _set, address[] memory _addresses) internal {
        for (uint i = 0; i < _addresses.length; i++) {
            _set.add(_addresses[i]);
        }
    }

    function _remove(EnumerableSet.AddressSet storage _set, address[] memory _addresses) internal {
        for (uint i = 0; i < _addresses.length; i++) {
            _set.remove(_addresses[i]);
        }
    }

    function _list(EnumerableSet.AddressSet storage _set) internal view returns(address[] memory) {
        address[] memory result = new address[](_set.length());
        for (uint i = 0; i < _set.length(); i++) {
            result[i] = _set.at(i);
        }
        return result;
    }
}
/**
 * @dev BerezkaTokenAdapterStakingGovernance contract.
 * Main function of this contract is to maintains a Set of Staking Adapters of Berezka DAO
 * @author Vasin Denis <denis.vasin@easychain.tech>
 */
function listStakings() external view returns (address[] memory) {
    return _list(stakings);
}

// View functions