Open code423n4 opened 3 years ago
Unused mapPID_finalised
addressed https://github.com/vetherasset/vaderprotocol-contracts/commit/6f961e6cd159e905ef53a5a067f956d21f8a46ee
@0xBrian note that this was not addressed by the link provided
@dmvt Sorry, I only meant to note that the mapPID_finalised
issue was addressed. The other issue about saving gas by extracting to a struct, whatever that means, still remains to be considered.
Handle
paulius.eth
Vulnerability details
Impact
Mappings are expensive. All PID related variables could be extracted to a struct: mapping(uint => GrantDetails) public mapPID_grant; mapping(uint => address) public mapPID_address; mapping(uint => string) public mapPID_type; mapping(uint => uint) public mapPID_votes; mapping(uint => uint) public mapPID_timeStart; mapping(uint => bool) public mapPID_finalising; mapping(uint => bool) public mapPID_finalised; mapping(uint => mapping(address => uint)) public mapPIDMember_votes; By the way, mapPID_finalised is set but not used anywhere.