Poor sequence of actions in updateCanvas#
Low Risk
In Create.sol the updateCanvas function is used to update a canvas. When updating, it stores isImmutable property first, then it reads it from storage to check if it is immutable, and only if it is not, other properties can be updated. This can cause you to lock wrongly configured canvas.
Example#
- User A has a canvas with
feeBpsequal to100. - He wants to change
feeBpsto200and lock the canvas. - He executes
updateCanvaswithfeeBps=200andisImmutable=true. - The
isImmutableproperty gets stored first, therefore the canvas is now immutable. - Because canvas is immutable,
feeBpsis not saved.
User A locked his canvas, but feeBps is still 100. He can't change feeBps, unless the DAO unlocks his canvas.
Recommendation#
Move part of the code, that changes canvas to immutable, to the end of the function. This way you are locking the canvas after making all the other changes.