Move.

Post

Share your knowledge.

YJS.
YJS94
Mar 19, 2025
Expert Q&A

Comparing Vectors in Move with Mappings in Solidity

I’m trying to understand the differences between vectors in Move and mappings in Solidity. I’ve heard that they differ in terms of key types and iteration capabilities, but I’m not clear on the specifics. Can someone break down the main differences?

  • Move CLI
  • Move
0
1
Share
Comments
.

Answers

1
mssoni.
Mar 20 2025, 11:05

A Move Table is quite similar to a Solidity mapping rather than a vector. Here are some key differences:

  • vectors in Move are keyed strictly by integers, while Tables can use any type as a key.
  • vectors come with a size limit, whereas Tables can store an unlimited number of elements.
  • Iterating over vectors is straightforward; however, Tables do not support direct iteration similar to mappings, although you can use LinkedTable for iteration purposes.
1
Comments
.

Do you know the answer?

Please log in and share it.

Move is an executable bytecode language used to implement custom transactions and smart contracts.

148Posts231Answers
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Reward CampaignMay
We use cookies to ensure you get the best experience on our website.
More info