Post
Share your knowledge.
How do I fix a type mismatch error in a Move transaction?
I'm working on a transaction in Move language involving a purchase function for a kiosk, but I keep hitting an error indicating a type mismatch, specifically EFieldTypeMismatch: u64 = 2
from dynamic_field.move
. I've tried using BUYER_KIOSK
instead of BUYER
, but with no success. The transaction script involves splitting coins, assigning to coin
, making move-call
s, and confirming requests, but it fails at remove_child_object
. Could this error be due to the incorrect type for function arguments? How can I resolve this?
(\
PRICE="5000000000"; \
PACKAGE="0x4"; \
PURCHASE_COIN="0x5"; \
ITEM="0x6"; \
ITEM_TRANSFER_POLICY_TYPE="<0x2::transfer_policy::TransferPolicy<$PACKAGE::factory::Nft>>"; \
ITEM_TRANSFER_POLICY="0x7"; \
SELLER_KIOSK="0x8"; \
BUYER_KIOSK="0x9"; \
BUYER="0x10"; \
sui client ptb \
--split-coins @$PURCHASE_COIN "[$PRICE]" \
--assign coin \
--move-call 0x2::kiosk::purchase "<0x2::kiosk::Kiosk>" @$SELLER_KIOSK @$ITEM coin.0 \
--assign purchase_result \
--move-call 0x2::transfer_policy::confirm_request $ITEM_TRANSFER_POLICY_TYPE @$ITEM_TRANSFER_POLICY purchase_result.1 \
--move-call 0x2::transfer::public_transfer "<0x2::kiosk::Item>" purchase_result.0 @$BUYER \
--gas-budget 1000000000 \
--json\
)
- Move CLI
- Move
Answers
2As the error is mentioning, there could be a type mismatch. Please provide your code and show where is the problem.
Yeah, thanks mate, edited my question. Could you give it a look now?
It seems like the misunderstanding stems from the expected type in your transaction. The <TYPE>
in your move-call
isn't necessarily the type of the first argument; instead, the function may be using generics. By ensuring that the type arguments match what's expected by the function, you may resolve the issue.
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.

- ... SUIderiss+5
- ... SUIRamirez+5
- ... SUIElvin CLONE +5
- ... SUI
- ... SUI
- ... SUI
- ... SUIBritain+2