Skip to content

Sui 执行交易 报错 MovePrimitiveRuntimeError #279

Answered by qiwihui
passer-byzhang asked this question in Q&A
Discussion options

You must be logged in to vote

你可以在 Sui Explorer 上查看对应的 bytecode: https://explorer.sui.io/object/0x9013e8f4c58f48251fa58c6d26ef00721fc41755?module=transfer 。报错显示在 function: 0, instruction: 32 就是第 0 个函数 32 号指令(第0和函数并不一定是bytecode里的第0个,顺序可能不一样,只是你这个文件里刚好只有一个函数),对于的是

B6:
	30: ImmBorrowLoc[4](Arg4: vector<u64>)
	31: CopyLoc[9](loc3: u64)
	32: VecImmBorrow(8)
	33: StLoc[8](loc2: &u64)

我感觉是在一个判断小于的分支之后, vector borrow 的索引出错,但是不太确定,有源码的话可以更好定位一些。此处没有进行 assert 判断,如果判断了会有错误编号在报错的显示中。

完成 Bytecode:

// Move bytecode v6
module 9013e8f4c58f48251fa58c6d26ef00721fc41755.transfer {
use 9013e8f4c58f48251fa58c6d26ef00721fc41755::Box;
use 9013e8f4c58f48251fa58c6d26ef00721fc41755::tickets;
use 0000000000000000000000000000000000000002::tx_co…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@passer-byzhang
Comment options

@passer-byzhang
Comment options

@qiwihui
Comment options

Answer selected by passer-byzhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants