code-423n4 / 2022-01-trader-joe-findings

2 stars 0 forks source link

Long revert messages #299

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

pauliax

Vulnerability details

Impact

Shortening revert strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the revert condition has been met. e.g.:

  require(
        _startTime > block.timestamp,
        "RocketJoeStaking: rJOE minting needs to start after the current timestamp"
    );
  require(
      balance > 0,
      "LaunchEvent: expected user to have non-zero balance to perform emergency withdraw"
  );
  require(
      msg.sender == address(WAVAX),
      "LaunchEvent: you can't send AVAX directly to this contract"
  );
cryptofish7 commented 2 years ago

Duplicate of #242