There's no hard limit but there's a proposal (pending since 2018) to introduce one: EIP-1985: Sane limits for certain EVM parameters.
buffer size, code size, memory size is a range between 0
and 0xffffffff
(2**32 - 1
, 4294967295
). It affects the following instructions:
CALLDATASIZE
(0x36
),
CODESIZE
(0x38
),
EXTCODESIZE
(0x3b
),
RETURNDATASIZE
(0x3d
),
MSIZE
(0x59
),
PC
(0x58
).
You are however very unlikely to ever hit this limit anyway. You will run out of gas long before then.
Will this array "break" when someone calls the public
getter function if there are too many entries?
If the getter was to return the whole array, it would break, in the sense that user's transaction would run out of gas and revert. This is the reason why array getters return only one item at a time. This way it's perfectly safe regardless of how big the array gets.
By the way, depending on how it's meant to be used, it might be more efficient to use a mapping. For example if borrower
is unique, you could use it as the key so that it's not stored on chain at all. Anyone who wants to check a particular borrower (identified by an address) already knows this address and can use it for the lookup.
allListings
is a public function" - it's actuallyprivate
in your snippet :)