Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 261 additions & 0 deletions docs/utils/enumerablemaplib.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,21 @@ function set(Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value)
Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.

### set(Bytes32ToBytes32Map,bytes32,bytes32,uint256)

```solidity
function set(
Bytes32ToBytes32Map storage map,
bytes32 key,
bytes32 value,
uint256 cap
) internal returns (bool)
```

Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.
Reverts if the map grows bigger than the custom on-the-fly capacity `cap`.

### remove(Bytes32ToBytes32Map,bytes32)

```solidity
Expand All @@ -144,6 +159,20 @@ function remove(Bytes32ToBytes32Map storage map, bytes32 key)
Removes a key-value pair from the map.
Returns true if `key` was removed from the map, that is if it was present.

### update(Bytes32ToBytes32Map,bytes32,bytes32,bool,uint256)

```solidity
function update(
Bytes32ToBytes32Map storage map,
bytes32 key,
bytes32 value,
bool isAdd,
uint256 cap
) internal returns (bool)
```

Shorthand for `isAdd ? map.set(key, value, cap) : map.remove(key)`.

### contains(Bytes32ToBytes32Map,bytes32)

```solidity
Expand Down Expand Up @@ -221,6 +250,21 @@ function set(Bytes32ToUint256Map storage map, bytes32 key, uint256 value)
Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.

### set(Bytes32ToUint256Map,bytes32,uint256,uint256)

```solidity
function set(
Bytes32ToUint256Map storage map,
bytes32 key,
uint256 value,
uint256 cap
) internal returns (bool)
```

Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.
Reverts if the map grows bigger than the custom on-the-fly capacity `cap`.

### remove(Bytes32ToUint256Map,bytes32)

```solidity
Expand All @@ -232,6 +276,20 @@ function remove(Bytes32ToUint256Map storage map, bytes32 key)
Removes a key-value pair from the map.
Returns true if `key` was removed from the map, that is if it was present.

### update(Bytes32ToUint256Map,bytes32,uint256,bool,uint256)

```solidity
function update(
Bytes32ToUint256Map storage map,
bytes32 key,
uint256 value,
bool isAdd,
uint256 cap
) internal returns (bool)
```

Shorthand for `isAdd ? map.set(key, value, cap) : map.remove(key)`.

### contains(Bytes32ToUint256Map,bytes32)

```solidity
Expand Down Expand Up @@ -309,6 +367,21 @@ function set(Bytes32ToAddressMap storage map, bytes32 key, address value)
Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.

### set(Bytes32ToAddressMap,bytes32,address,uint256)

```solidity
function set(
Bytes32ToAddressMap storage map,
bytes32 key,
address value,
uint256 cap
) internal returns (bool)
```

Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.
Reverts if the map grows bigger than the custom on-the-fly capacity `cap`.

### remove(Bytes32ToAddressMap,bytes32)

```solidity
Expand All @@ -320,6 +393,20 @@ function remove(Bytes32ToAddressMap storage map, bytes32 key)
Removes a key-value pair from the map.
Returns true if `key` was removed from the map, that is if it was present.

### update(Bytes32ToAddressMap,bytes32,address,bool,uint256)

```solidity
function update(
Bytes32ToAddressMap storage map,
bytes32 key,
address value,
bool isAdd,
uint256 cap
) internal returns (bool)
```

Shorthand for `isAdd ? map.set(key, value, cap) : map.remove(key)`.

### contains(Bytes32ToAddressMap,bytes32)

```solidity
Expand Down Expand Up @@ -397,6 +484,21 @@ function set(Uint256ToBytes32Map storage map, uint256 key, bytes32 value)
Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.

### set(Uint256ToBytes32Map,uint256,bytes32,uint256)

```solidity
function set(
Uint256ToBytes32Map storage map,
uint256 key,
bytes32 value,
uint256 cap
) internal returns (bool)
```

Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.
Reverts if the map grows bigger than the custom on-the-fly capacity `cap`.

### remove(Uint256ToBytes32Map,uint256)

```solidity
Expand All @@ -408,6 +510,20 @@ function remove(Uint256ToBytes32Map storage map, uint256 key)
Removes a key-value pair from the map.
Returns true if `key` was removed from the map, that is if it was present.

### update(Uint256ToBytes32Map,uint256,bytes32,bool,uint256)

```solidity
function update(
Uint256ToBytes32Map storage map,
uint256 key,
bytes32 value,
bool isAdd,
uint256 cap
) internal returns (bool)
```

Shorthand for `isAdd ? map.set(key, value, cap) : map.remove(key)`.

### contains(Uint256ToBytes32Map,uint256)

```solidity
Expand Down Expand Up @@ -485,6 +601,21 @@ function set(Uint256ToUint256Map storage map, uint256 key, uint256 value)
Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.

### set(Uint256ToUint256Map,uint256,uint256,uint256)

```solidity
function set(
Uint256ToUint256Map storage map,
uint256 key,
uint256 value,
uint256 cap
) internal returns (bool)
```

Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.
Reverts if the map grows bigger than the custom on-the-fly capacity `cap`.

### remove(Uint256ToUint256Map,uint256)

```solidity
Expand All @@ -496,6 +627,20 @@ function remove(Uint256ToUint256Map storage map, uint256 key)
Removes a key-value pair from the map.
Returns true if `key` was removed from the map, that is if it was present.

### update(Uint256ToUint256Map,uint256,uint256,bool,uint256)

```solidity
function update(
Uint256ToUint256Map storage map,
uint256 key,
uint256 value,
bool isAdd,
uint256 cap
) internal returns (bool)
```

Shorthand for `isAdd ? map.set(key, value, cap) : map.remove(key)`.

### contains(Uint256ToUint256Map,uint256)

```solidity
Expand Down Expand Up @@ -573,6 +718,21 @@ function set(Uint256ToAddressMap storage map, uint256 key, address value)
Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.

### set(Uint256ToAddressMap,uint256,address,uint256)

```solidity
function set(
Uint256ToAddressMap storage map,
uint256 key,
address value,
uint256 cap
) internal returns (bool)
```

Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.
Reverts if the map grows bigger than the custom on-the-fly capacity `cap`.

### remove(Uint256ToAddressMap,uint256)

```solidity
Expand All @@ -584,6 +744,20 @@ function remove(Uint256ToAddressMap storage map, uint256 key)
Removes a key-value pair from the map.
Returns true if `key` was removed from the map, that is if it was present.

### update(Uint256ToAddressMap,uint256,address,bool,uint256)

```solidity
function update(
Uint256ToAddressMap storage map,
uint256 key,
address value,
bool isAdd,
uint256 cap
) internal returns (bool)
```

Shorthand for `isAdd ? map.set(key, value, cap) : map.remove(key)`.

### contains(Uint256ToAddressMap,uint256)

```solidity
Expand Down Expand Up @@ -661,6 +835,21 @@ function set(AddressToBytes32Map storage map, address key, bytes32 value)
Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.

### set(AddressToBytes32Map,address,bytes32,uint256)

```solidity
function set(
AddressToBytes32Map storage map,
address key,
bytes32 value,
uint256 cap
) internal returns (bool)
```

Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.
Reverts if the map grows bigger than the custom on-the-fly capacity `cap`.

### remove(AddressToBytes32Map,address)

```solidity
Expand All @@ -672,6 +861,20 @@ function remove(AddressToBytes32Map storage map, address key)
Removes a key-value pair from the map.
Returns true if `key` was removed from the map, that is if it was present.

### update(AddressToBytes32Map,address,bytes32,bool,uint256)

```solidity
function update(
AddressToBytes32Map storage map,
address key,
bytes32 value,
bool isAdd,
uint256 cap
) internal returns (bool)
```

Shorthand for `isAdd ? map.set(key, value, cap) : map.remove(key)`.

### contains(AddressToBytes32Map,address)

```solidity
Expand Down Expand Up @@ -749,6 +952,21 @@ function set(AddressToUint256Map storage map, address key, uint256 value)
Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.

### set(AddressToUint256Map,address,uint256,uint256)

```solidity
function set(
AddressToUint256Map storage map,
address key,
uint256 value,
uint256 cap
) internal returns (bool)
```

Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.
Reverts if the map grows bigger than the custom on-the-fly capacity `cap`.

### remove(AddressToUint256Map,address)

```solidity
Expand All @@ -760,6 +978,20 @@ function remove(AddressToUint256Map storage map, address key)
Removes a key-value pair from the map.
Returns true if `key` was removed from the map, that is if it was present.

### update(AddressToUint256Map,address,uint256,bool,uint256)

```solidity
function update(
AddressToUint256Map storage map,
address key,
uint256 value,
bool isAdd,
uint256 cap
) internal returns (bool)
```

Shorthand for `isAdd ? map.set(key, value, cap) : map.remove(key)`.

### contains(AddressToUint256Map,address)

```solidity
Expand Down Expand Up @@ -837,6 +1069,21 @@ function set(AddressToAddressMap storage map, address key, address value)
Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.

### set(AddressToAddressMap,address,address,uint256)

```solidity
function set(
AddressToAddressMap storage map,
address key,
address value,
uint256 cap
) internal returns (bool)
```

Adds a key-value pair to the map, or updates the value for an existing key.
Returns true if `key` was added to the map, that is if it was not already present.
Reverts if the map grows bigger than the custom on-the-fly capacity `cap`.

### remove(AddressToAddressMap,address)

```solidity
Expand All @@ -848,6 +1095,20 @@ function remove(AddressToAddressMap storage map, address key)
Removes a key-value pair from the map.
Returns true if `key` was removed from the map, that is if it was present.

### update(AddressToAddressMap,address,address,bool,uint256)

```solidity
function update(
AddressToAddressMap storage map,
address key,
address value,
bool isAdd,
uint256 cap
) internal returns (bool)
```

Shorthand for `isAdd ? map.set(key, value, cap) : map.remove(key)`.

### contains(AddressToAddressMap,address)

```solidity
Expand Down
Loading