The function getDeploymentBlock()
in the Holographer
contract returns an incorrect data type
#107
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
duplicate
This issue or pull request already exists
edited-by-warden
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
responded
The Holograph team has reviewed and responded
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/Holographer.sol#L174
Vulnerability details
Impact
The function
getDeploymentBlock()
present in theHolographer
contract returns anaddress
, while everything indicates that the underlying value holds auint256
that represents a block number, and even the function is named after that. This is caused because the contract uses unstructured storage and the slot value is sloaded directly into anaddress
type, and could make integrations with this code fail, or even truncate the returned value since the address type is 20 bytes long.The error is also present in the interface
HolographerInterface
.Recommendation
The return type in the contract and interface should be changed to
uint256
.The text was updated successfully, but these errors were encountered: