I want to understand how the size limit works in Sui move
objects. I know that the size limit for a single object is 250kb. Let’s say I am creating an object of the type:
struct Table1 has key, store{
id: UID,
list: Table<String, bool>
}
I create an object calling an init function from a move file:
fun init(ctx: &mut TxContext) {
let table_obj = Table1 {
id: object::new(ctx),
list: table::new(ctx)
};
transfer::public_transfer(channel_list, tx_context::sender(ctx));
}
Now I keep adding new strings to the table calling this function:
public entry fun add_channel(
table_obj: &mut Table1,
elm: String
){
table::add(&mut table_obj.list, elm, true);
}
Let’s assume each unique string added to the table is of size 10 bytes so for each entry we add 11 bytes (including the boolean value), so the total values that can be added on the object would be 250000/11 ~ 22727 strings. Is there any gap in my understanding, or the upper limit of the data that can be added to the table would be higher (or lower)?