code-423n4 / 2022-12-forgeries-findings

0 stars 0 forks source link

Wrong calculation of MONTH_IN_SECONDS #358

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

Lines of code

https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L33 https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L86 https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L95

Vulnerability details

Wrong calculation of MONTH_IN_SECONDS :

line 33 on VRFNFTRandomDraw.sol is calculating 30 weeks of 7 days instead of 30 days. 30 weeks of 7 days = (3600 24 7) 30. 30 days = 3600 24 * 30.

so https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L86 and https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L95 wont work properly

c4-judge commented 1 year ago

gzeon-c4 marked the issue as duplicate of #273

c4-judge commented 1 year ago

gzeon-c4 marked the issue as satisfactory