Skip to content

Commit

Permalink
fix: slither
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 committed Nov 6, 2024
1 parent 9e6deb9 commit 3533869
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions solidity/src/libraries/BytesLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,7 @@ library BytesLib {

for {
let cc := add(_postBytes, 0x20)
} // the next line is the loop condition:
// while(uint256(mc < end) + cb == 2)
} // while(uint256(mc < end) + cb == 2) // the next line is the loop condition:
eq(add(lt(mc, end), cb), 2) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
Expand Down
3 changes: 1 addition & 2 deletions solidity/src/libraries/UnsafeBytesLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,7 @@ library UnsafeBytesLib {

for {
let cc := add(_postBytes, 0x20)
} // the next line is the loop condition:
// while(uint256(mc < end) + cb == 2)
} // while(uint256(mc < end) + cb == 2) // the next line is the loop condition:
eq(add(lt(mc, end), cb), 2) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
Expand Down
11 changes: 6 additions & 5 deletions solidity/src/migrations/Chainlink.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ contract PragmaAggregatorV3 {
pragmaInterface.updateDataFeeds{value: fee}(priceUpdateData);

// refund remaining eth
payable(msg.sender).call{value: address(this).balance}("");
// (bool success, ) = payable(msg.sender).call{value: address(this).balance}("");
// require(success, "Transfer failed.");
}

Check failure

Code scanning / Slither

Functions that send Ether to arbitrary destinations High


function decimals() public view virtual returns (uint8) {
Expand Down Expand Up @@ -68,12 +69,12 @@ contract PragmaAggregatorV3 {
}

function getRoundData(
uint80 _roundId
uint80 roundId
)
external
view
returns (
uint80 roundId,
uint80,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
Expand All @@ -82,11 +83,11 @@ contract PragmaAggregatorV3 {
{
SpotMedian memory price = pragmaInterface.getSpotMedianFeed(feedId);
return (
_roundId,
roundId,
int256(price.price),
price.metadata.timestamp,
price.metadata.timestamp,
_roundId
roundId
);
}

Expand Down

0 comments on commit 3533869

Please sign in to comment.