Skip to content

RUNTIME_DISPATCH_ERROR: Reentrancy detected error #414

Answered by kshitjee
ariesgun asked this question in Questions
Discussion options

You must be logged in to vote

@runtian-zhou perhaps we can make this clearer given the complexity.

@ariesgun, the issue is possibly that your hooks call into primary_fungible_store.move, please let me know if this is not the case.

the distinction lies in the fact that:

a) contracts interacting with an asset (say FAcoin) can continue to call into primary_fungible_store::withdraw/deposit, since there is no risk of reentrancy.

i.e. pfs::withdraw -> dfa::withdraw -> fa_coin::withdraw -> fa::withdraw_with_ref, so we're good.

b) contracts that define their asset and hook (so you, the person deploying the FACoin module), can't call into ANY function in pfs WITHIN your hook logic. this causes a potential reentrancy, which you…

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@kshitjee
Comment options

Answer selected by ariesgun
@kshitjee
Comment options

@ariesgun
Comment options

@kshitjee
Comment options

@ariesgun
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants