diff --git a/src/Olifanton/Interop/Boc/Slice.php b/src/Olifanton/Interop/Boc/Slice.php index 8b83196..d3d34c3 100644 --- a/src/Olifanton/Interop/Boc/Slice.php +++ b/src/Olifanton/Interop/Boc/Slice.php @@ -312,7 +312,7 @@ public function loadMaybeRef(): ?Cell public function loadString(?int $bytes = null): string { $bytes = $bytes === null - ? $this->loadBits($this->length) + ? $this->loadBits($this->getFreeBits()) : $this->loadBits($bytes); return trim(Bytes::arrayToBytes($bytes), "\0");