Closed code423n4 closed 2 years ago
admin functions are marked as payable
to save gas
Would've been great to mention this in the README in the optimizations section. I agree though, since they're privileged functions, chances of sending ETH together are low.
Downgrading to non-crit QA.
part of warden's QA: #261
Lines of code
https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L223-L246
Vulnerability details
Impact
The
owner
of the contract can sendvalue
by mistake when callsetBaseURI
andsetFee
, the ETH will stuck in the contractProof of Concept
function setBaseURI(string memory _baseURI) public payable onlyOwner {
function setFee(uint256 _fee) public payable onlyOwner {
Tools Used
Review
Recommended Mitigation Steps
Remove the
payable
modifier of thesetBaseURI
andsetFee
functions