tokamak-network / crossTrade

Cross Trade is a new core service for optimistic rollups that complements standard withdrawals and fast withdrawals. It is trustless and do not require extensive backend.
4 stars 1 forks source link

J_12 use check-effect-interaction pattern [low~medium] #14

Closed usgeeus closed 5 months ago

usgeeus commented 6 months ago

Configuration

Description

Even if we don't have a reentry attack issue, this pattern should be widely used.

Lines of Codes

To all functions example here image

Recommendation

example here Change the location of the external call sendMessage and value assignments to editEndTime variables.

Demo

example here

editEndTime[l2HashValue] = block.timestamp + chainData[_l2chainId].editTime;
LL1CroosDomainMessenger(crossDomainMessenger).sendMessage(chainData[_l2chainId].l2fastWithdrawContract, message, _minGasLimit);
zzooppii commented 5 months ago

https://github.com/tokamak-network/crossTrade/commit/db5a6fe85ee631020658eb1febcb13c6d17a8a13

usgeeus commented 5 months ago

Solved, closing this issue.