mirror of
https://github.com/logos-storage/logos-storage-contracts-eth.git
synced 2026-01-16 12:13:09 +00:00
Create a DAL lib with a Database struct that contains all tables and relationships. Referential integrity is guaranteed.
24 lines
505 B
Solidity
24 lines
505 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.8;
|
|
|
|
library Utils {
|
|
function resize(bytes32[] memory array, uint256 newSize)
|
|
internal
|
|
pure
|
|
returns (bytes32[] memory)
|
|
{
|
|
require(newSize <= array.length, "size out of bounds");
|
|
|
|
if (newSize == 0) {
|
|
bytes32[] memory empty;
|
|
return empty;
|
|
} else {
|
|
bytes32[] memory sized = new bytes32[](newSize);
|
|
for (uint8 i = 0; i < newSize; i++) {
|
|
sized[i] = array[i];
|
|
}
|
|
return sized;
|
|
}
|
|
}
|
|
}
|