mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-02-26 21:30:35 +00:00
[utils] Remove Utils
No longer required
This commit is contained in:
parent
4f75159e02
commit
0ecce3094a
@ -6,11 +6,9 @@ import "@openzeppelin/contracts/utils/math/Math.sol";
|
|||||||
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
||||||
import "./Collateral.sol";
|
import "./Collateral.sol";
|
||||||
import "./Proofs.sol";
|
import "./Proofs.sol";
|
||||||
import "./libs/Utils.sol";
|
|
||||||
|
|
||||||
contract Marketplace is Collateral, Proofs {
|
contract Marketplace is Collateral, Proofs {
|
||||||
using EnumerableSet for EnumerableSet.Bytes32Set;
|
using EnumerableSet for EnumerableSet.Bytes32Set;
|
||||||
using Utils for EnumerableSet.Bytes32Set;
|
|
||||||
|
|
||||||
type RequestId is bytes32;
|
type RequestId is bytes32;
|
||||||
type SlotId is bytes32;
|
type SlotId is bytes32;
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
|
||||||
pragma solidity ^0.8.8;
|
|
||||||
|
|
||||||
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
||||||
|
|
||||||
library Utils {
|
|
||||||
using EnumerableSet for EnumerableSet.Bytes32Set;
|
|
||||||
|
|
||||||
function filter(
|
|
||||||
EnumerableSet.Bytes32Set storage set,
|
|
||||||
function(bytes32) internal view returns (bool) include
|
|
||||||
) internal view returns (bytes32[] memory result) {
|
|
||||||
bytes32[] memory selected = new bytes32[](set.length());
|
|
||||||
uint256 amount = 0;
|
|
||||||
|
|
||||||
for (uint256 i = 0; i < set.length(); i++) {
|
|
||||||
if (include(set.at(i))) {
|
|
||||||
selected[amount++] = set.at(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
result = new bytes32[](amount);
|
|
||||||
for (uint256 i = 0; i < result.length; i++) {
|
|
||||||
result[i] = selected[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user