U256Map
U256 to U256 Hash Map
The U256Map contract
allows users to manage a mapping between uint256
keys and uint256
values.
Constructor
U256Map()
Constructor for the U256Map contract.
Public Functions
exist
Check if a given key exists in the U256Map.
Parameters:
key
(uint256): Theuint256
key to check for existence.
Returns:
bool
:true
if the key exists,false
otherwise.
at
Retrieves the value stored at the specified index.
Parameters:
idx
(uint256): The index of the element to retrieve.
Returns:
uint256
: The value retrieved from the storage array at the given index.
set
Set a key-value pair in the U256Map.
Parameters:
key
: Theuint256
key to set.value
: Theuint256
value associated with the key.
get
Get the value associated with a given key in the U256Map.
Parameters:
key
: Theuint256
key to retrieve the associated value.
Returns:
value
: Theuint256
value associated with the key.
keyAt
Get the key based on its index.
Parameters:
idx
: Theuint256
index to retrieve the associated key.
Returns:
bytes
: The key value associated with the index.
valueAt
Get the value based on its index.
Parameters:
idx
: Theuint256
key to retrieve the associated index.
Returns:
The value retrieved from the map at the given index.
del
Delete a key-value pair from the U256Map.
Parameters:
key
: Theuint256
key to delete.
Last updated