This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
generated from Mens-Ludos/solidity-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from RedDuck-Software/fix/audit-fixes
Fix/audit fixes
- Loading branch information
Showing
28 changed files
with
2,723 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.9; | ||
|
||
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol"; | ||
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; | ||
|
||
import "../access/WithMidasAccessControl.sol"; | ||
import "../libraries/DecimalsCorrectionLibrary.sol"; | ||
import "../interfaces/IDataFeed.sol"; | ||
|
||
contract AggregatorV3DeprecatedMock is AggregatorV3Interface { | ||
int256 private _latestRoundData; | ||
uint80 private _latestRoundId; | ||
|
||
function decimals() external view returns (uint8) { | ||
return 8; | ||
} | ||
|
||
function description() external view returns (string memory) {} | ||
|
||
function version() external view returns (uint256) {} | ||
|
||
function setRoundData(int256 _data) external { | ||
_latestRoundData = _data; | ||
_latestRoundId++; | ||
} | ||
|
||
function getRoundData(uint80 _roundId) | ||
external | ||
view | ||
returns ( | ||
uint80 roundId, | ||
int256 answer, | ||
uint256 startedAt, | ||
uint256 updatedAt, | ||
uint80 answeredInRound | ||
) | ||
{} | ||
|
||
function latestRoundData() | ||
external | ||
view | ||
returns ( | ||
uint80 roundId, | ||
int256 answer, | ||
uint256 startedAt, | ||
uint256 updatedAt, | ||
uint80 answeredInRound | ||
) | ||
{ | ||
// solhint-disable-next-line not-rely-on-time | ||
return (_latestRoundId, -1, 0, block.timestamp, 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.9; | ||
|
||
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol"; | ||
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; | ||
|
||
import "../access/WithMidasAccessControl.sol"; | ||
import "../libraries/DecimalsCorrectionLibrary.sol"; | ||
import "../interfaces/IDataFeed.sol"; | ||
|
||
contract AggregatorV3UnhealthyMock is AggregatorV3Interface { | ||
int256 private _latestRoundData; | ||
uint80 private _latestRoundId; | ||
|
||
function decimals() external view returns (uint8) { | ||
return 8; | ||
} | ||
|
||
function description() external view returns (string memory) {} | ||
|
||
function version() external view returns (uint256) {} | ||
|
||
function setRoundData(int256 _data) external { | ||
_latestRoundData = _data; | ||
_latestRoundId++; | ||
} | ||
|
||
function getRoundData(uint80 _roundId) | ||
external | ||
view | ||
returns ( | ||
uint80 roundId, | ||
int256 answer, | ||
uint256 startedAt, | ||
uint256 updatedAt, | ||
uint80 answeredInRound | ||
) | ||
{} | ||
|
||
function latestRoundData() | ||
external | ||
view | ||
returns ( | ||
uint80 roundId, | ||
int256 answer, | ||
uint256 startedAt, | ||
uint256 updatedAt, | ||
uint80 answeredInRound | ||
) | ||
{ | ||
return ( | ||
_latestRoundId, | ||
_latestRoundData, | ||
0, | ||
// solhint-disable-next-line not-rely-on-time | ||
block.timestamp - 2 days, | ||
0 | ||
); | ||
} | ||
} |
Oops, something went wrong.