Create an object with Table datatype initialized with 100 elements

Can I create an object with a Table datatype initialized with 100 elements in a single transaction?
For example with the Object datatype:

    struct Table1 has key, store{
        id: UID,
        list: Table<String, bool>
    }

I want to initialize the list Table with 100 elements when initializing the Table1 Object.

3 Likes

@tahlil Yes, it’s possible; a dynamic field-backed collection such as Table can store millions of elements.

1 Like

@taki Isn’t there a limit of 250kb for a single object?

1 Like

@tahlil The limit does not apply to child objects or dynamic fields. It’s only to the data stored directly in the fields you see in the type

1 Like

can you please clarify it, i am confused too like @tahlil asked.

So, let say.

struct Table1 has key, store{
id: UID,
list: Table<String, bool>
}

I can store millions or billions of name in the list?

1 Like