code-423n4 / 2021-12-yetifinance-findings

0 stars 0 forks source link

Storage optimization #231

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

0x1f8b

Vulnerability details

Impact

Gas saving.

Proof of Concept

It's possible to optimize the structures struct ChainlinkResponse and TellorResponse from PriceFeed to use less storage slots.

Tools Used

Recommended Mitigation Steps

Use the following structure:

struct ChainlinkResponse {
        int256 answer;
        uint256 timestamp;
        uint80 roundId;
        bool success;
        uint8 decimals;
    }

    struct TellorResponse {
        uint256 value;
        uint256 timestamp;
        bool ifRetrieve;
        bool success;
    }
kingyetifinance commented 2 years ago

@LilYeti : Duplicate #5 #6

alcueca commented 2 years ago

Duplicate of #224