Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Market cleanup: Unnecessary write permission for LockedTable in AddBalance #1443

Open
wadealexc opened this issue Jun 1, 2021 · 0 comments

Comments

@wadealexc
Copy link

Description

msm, err := st.mutator(adt.AsStore(rt)).withEscrowTable(WritePermission).
withLockedTable(WritePermission).build()
builtin.RequireNoErr(rt, err, exitcode.ErrIllegalState, "failed to load state")

Market.AddBalance creates a marketStateMutation with WritePermission for st.LockedTable. As only st.EscrowTable is read from / written to, this permission is unnecessary and may cause extraneous state writes.

Recommendation

Remove the permission

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant