Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: oracles with firewalls on mint and burn #105

Merged
merged 54 commits into from
Apr 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
66eb024
feat: oracles with firewalls on mint and burn
GuillaumeNervoXS Feb 27, 2024
55cb6d5
feat: oracles with target value as max
GuillaumeNervoXS Feb 27, 2024
e04c233
feat: fixed tests + test on mint and burn firewalls oracles
GuillaumeNervoXS Feb 28, 2024
9b7f422
test updateOracle
GuillaumeNervoXS Feb 29, 2024
120dd7d
feat: start testing deployment
GuillaumeNervoXS Mar 1, 2024
d29323a
feat: start scripts
GuillaumeNervoXS Mar 5, 2024
e2f708e
feat: mint and burn test done
GuillaumeNervoXS Mar 5, 2024
c383fb0
chore: try to fix linter issues
GuillaumeNervoXS Mar 5, 2024
feef55a
feat: testing done
GuillaumeNervoXS Mar 5, 2024
2f8fce5
format: prettier contracts
0xtekgrinder Mar 7, 2024
04ac2e1
chore : add scripts to ignored files in slither
0xtekgrinder Mar 7, 2024
dbe114a
chore: add uri env variables to ci tests
0xtekgrinder Mar 7, 2024
6afa900
fix: SwapTest and SavingsTest now compiles
0xtekgrinder Mar 10, 2024
bfa582e
fix part of the stack too deep when via-ir
GuillaumeNervoXS Mar 6, 2024
2742aa2
chore remap import from test
GuillaumeNervoXS Mar 6, 2024
ac8b2de
find which test files has compilation problem
GuillaumeNervoXS Mar 8, 2024
b83ff6b
fix all compilation tests except RedeemTest
GuillaumeNervoXS Mar 11, 2024
74b17b2
add back the RedeemTest
GuillaumeNervoXS Mar 11, 2024
4c6f8cf
fix redeem test compilation
GuillaumeNervoXS Mar 11, 2024
b0c9ee3
chore: setup repo inside ci
0xtekgrinder Mar 11, 2024
31b853d
chore: move setup repo action to actions subdirectory
0xtekgrinder Mar 11, 2024
54fb2dd
start burn protection for users
GuillaumeNervoXS Mar 13, 2024
41d56b5
fix firewall and user protection + tests
GuillaumeNervoXS Mar 13, 2024
218ef40
feat: add back burnRatio deviation user protection
GuillaumeNervoXS Mar 14, 2024
621d3c8
fix burnRatio protection
GuillaumeNervoXS Mar 14, 2024
93d4184
return ratio
GuillaumeNervoXS Mar 14, 2024
d509e5f
tests fixed
GuillaumeNervoXS Mar 20, 2024
cacd0fb
decimal issue
GuillaumeNervoXS Mar 20, 2024
159ed48
working tests
GuillaumeNervoXS Mar 21, 2024
f6be794
yarn prettier
GuillaumeNervoXS Mar 21, 2024
81c22ce
add bERNX + new target exposures
GuillaumeNervoXS Mar 21, 2024
df4f36e
testing after adding bERNX
GuillaumeNervoXS Mar 21, 2024
565cdaf
feat: change updateOracle to only trustedSeller only
GuillaumeNervoXS Mar 21, 2024
fb88360
add fork block number option
GuillaumeNervoXS Mar 22, 2024
d88e96d
change input to secret
GuillaumeNervoXS Mar 22, 2024
727afa6
revert prev change
GuillaumeNervoXS Mar 22, 2024
ba97362
add space
GuillaumeNervoXS Mar 22, 2024
3103458
fix: fix install
BaptistG Mar 22, 2024
0cdbe3c
update vscode settings
GuillaumeNervoXS Mar 22, 2024
6684097
reduce stack too deep
GuillaumeNervoXS Mar 22, 2024
5fa9919
fix burn test
GuillaumeNervoXS Mar 22, 2024
2c06fd8
revert deadline tests changes
GuillaumeNervoXS Mar 22, 2024
8623ccf
feat: USDA setup (#108)
sogipec Mar 25, 2024
7f4db42
Add a test on non arbitrage Mint->Burn
GuillaumeNervoXS Mar 27, 2024
60350fd
update post review
GuillaumeNervoXS Mar 27, 2024
cee97ae
removed checks on oracle update
GuillaumeNervoXS Mar 27, 2024
b75b0f0
compiling version
GuillaumeNervoXS Mar 27, 2024
e5052ff
fix tests
GuillaumeNervoXS Mar 27, 2024
b5489b0
fix all tests and deploy tests
GuillaumeNervoXS Mar 28, 2024
794b604
chore: review minor changes
GuillaumeNervoXS Mar 28, 2024
9235e72
update oracle hyperparameters
GuillaumeNervoXS Mar 28, 2024
e0f3824
remove test on no arbitrage --> impossible with the user protections
GuillaumeNervoXS Mar 28, 2024
ea38373
fix: invariant testing
GuillaumeNervoXS Mar 28, 2024
ea9f6f2
deployed update transmuter
GuillaumeNervoXS Mar 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test updateOracle
GuillaumeNervoXS committed Feb 29, 2024
commit 9b7f422aebbc2d281051079824a8fa31bf0c73ce
2 changes: 2 additions & 0 deletions contracts/interfaces/ITransmuter.sol
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ import { IDiamondCut } from "./IDiamondCut.sol";
import { IDiamondEtherscan } from "./IDiamondEtherscan.sol";
import { IDiamondLoupe } from "./IDiamondLoupe.sol";
import { IGetters } from "./IGetters.sol";
import { IOracle } from "./IOracle.sol";
import { IRedeemer } from "./IRedeemer.sol";
import { IRewardHandler } from "./IRewardHandler.sol";
import { ISettersGovernor, ISettersGuardian } from "./ISetters.sol";
@@ -51,6 +52,7 @@ interface ITransmuter is
IDiamondEtherscan,
IDiamondLoupe,
IGetters,
IOracle,
IRedeemer,
IRewardHandler,
ISettersGovernor,
52 changes: 36 additions & 16 deletions contracts/transmuter/facets/Getters.sol
Original file line number Diff line number Diff line change
@@ -49,17 +49,21 @@
}

/// @inheritdoc IGetters
function getCollateralMintFees(
address collateral
) external view returns (uint64[] memory xFeeMint, int64[] memory yFeeMint) {
function getCollateralMintFees(address collateral)

Check failure on line 52 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace address·collateral) with ⏎········address·collateral
external

Check failure on line 53 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace ········external⏎········view⏎········returns·(uint64[]·memory·xFeeMint,·int64[]·memory·yFeeMint)⏎··· with ····)·external·view·returns·(uint64[]·memory·xFeeMint,·int64[]·memory·yFeeMint)
view
returns (uint64[] memory xFeeMint, int64[] memory yFeeMint)
{
Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];
return (collatInfo.xFeeMint, collatInfo.yFeeMint);
}

/// @inheritdoc IGetters
function getCollateralBurnFees(
address collateral
) external view returns (uint64[] memory xFeeBurn, int64[] memory yFeeBurn) {
function getCollateralBurnFees(address collateral)

Check failure on line 62 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace address·collateral) with ⏎········address·collateral
external

Check failure on line 63 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace ········external⏎········view⏎········returns·(uint64[]·memory·xFeeBurn,·int64[]·memory·yFeeBurn)⏎··· with ····)·external·view·returns·(uint64[]·memory·xFeeBurn,·int64[]·memory·yFeeBurn)
view
returns (uint64[] memory xFeeBurn, int64[] memory yFeeBurn)
{
Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];
return (collatInfo.xFeeBurn, collatInfo.yFeeBurn);
}
@@ -88,9 +92,11 @@
}

/// @inheritdoc IGetters
function getIssuedByCollateral(
address collateral
) external view returns (uint256 stablecoinsFromCollateral, uint256 stablecoinsIssued) {
function getIssuedByCollateral(address collateral)

Check failure on line 95 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace address·collateral) with ⏎········address·collateral
external

Check failure on line 96 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace ········external⏎········view⏎········returns·(uint256·stablecoinsFromCollateral,·uint256·stablecoinsIssued)⏎··· with ····)·external·view·returns·(uint256·stablecoinsFromCollateral,·uint256·stablecoinsIssued)
view
returns (uint256 stablecoinsFromCollateral, uint256 stablecoinsIssued)
{
TransmuterStorage storage ts = s.transmuterStorage();
uint256 _normalizer = ts.normalizer;
return (
@@ -106,7 +112,15 @@
}

/// @inheritdoc IGetters
function getManagerData(address collateral) external view returns (bool, IERC20[] memory, bytes memory) {
function getManagerData(address collateral)

Check failure on line 115 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace ⏎········external⏎········view⏎········returns·(⏎············bool,⏎············IERC20[]·memory,⏎············bytes·memory⏎········)⏎··· with ·external·view·returns·(bool,·IERC20[]·memory,·bytes·memory)
external
view
returns (
bool,
IERC20[] memory,
bytes memory
)
{
Collateral storage collatInfo = s.transmuterStorage().collaterals[collateral];
if (collatInfo.isManaged > 0) {
return (true, collatInfo.managerData.subCollaterals, collatInfo.managerData.config);
@@ -117,19 +131,25 @@
/// @inheritdoc IGetters
/// @dev This function is not optimized for gas consumption as for instance the `burn` value for collateral
/// is computed twice: once in `readBurn` and once in `getBurnOracle`
function getOracleValues(
address collateral
) external view returns (uint256 mint, uint256 burn, uint256 ratio, uint256 minRatio, uint256 redemption) {
function getOracleValues(address collateral)

Check failure on line 134 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace address·collateral) with ⏎········address·collateral
external

Check failure on line 135 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace ····external⏎········view⏎········returns·(⏎············uint256·mint,⏎············uint256·burn,⏎············uint256·ratio,⏎············uint256·minRatio,⏎············uint256·redemption⏎········)⏎··· with )·external·view·returns·(uint256·mint,·uint256·burn,·uint256·ratio,·uint256·minRatio,·uint256·redemption)
view
returns (
uint256 mint,
uint256 burn,
uint256 ratio,
uint256 minRatio,
uint256 redemption
)
{
bytes memory oracleConfig = s.transmuterStorage().collaterals[collateral].oracleConfig;
(burn, ratio) = LibOracle.readBurn(oracleConfig);
(minRatio, ) = LibOracle.getBurnOracle(collateral, oracleConfig);
return (LibOracle.readMint(oracleConfig), burn, ratio, minRatio, LibOracle.readRedemption(oracleConfig));
}

/// @inheritdoc IGetters
function getOracle(
address collateral
)
function getOracle(address collateral)

Check failure on line 152 in contracts/transmuter/facets/Getters.sol

GitHub Actions / lint

Replace address·collateral with ⏎········address·collateral⏎····
external
view
returns (
93 changes: 65 additions & 28 deletions contracts/transmuter/libraries/LibOracle.sol
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ library LibOracle {

/// @notice Reads the oracle value used during a redemption to compute collateral ratio for `oracleConfig`
/// @dev This value is only sensitive to compute the collateral ratio and deduce a penalty factor
function readRedemption(bytes memory oracleConfig) internal view returns (uint256) {
function readRedemption(bytes memory oracleConfig) internal view returns (uint256 oracleValue) {
(
OracleReadType oracleType,
OracleReadType targetType,
@@ -33,8 +33,7 @@ library LibOracle {
ITransmuterOracle externalOracle = abi.decode(oracleData, (ITransmuterOracle));
return externalOracle.readRedemption();
} else {
uint256 _targetPrice = read(targetType, BASE_18, targetData);
uint256 oracleValue = read(oracleType, _targetPrice, oracleData);
(oracleValue, ) = readSpotAndTarget(oracleType, targetType, oracleData, targetData);
// We don't consider the mint firewall as `readRedemption` is only used to compute the collateral ratio
// `getCollateralRatio` is only used in `_quoteRedemptionCurve` and `accrue` on the savingsVest
// `_quoteRedemptionCurve` use the collateral ratio to compute the penalty factor. Artificially increase the
@@ -63,10 +62,10 @@ library LibOracle {
ITransmuterOracle externalOracle = abi.decode(oracleData, (ITransmuterOracle));
return externalOracle.readMint();
}
uint256 _targetPrice = read(targetType, BASE_18, targetData);
oracleValue = read(oracleType, _targetPrice, oracleData);
uint256 targetPrice;
(oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData);
(uint128 mintDeviation, ) = abi.decode(hyperparameters, (uint128, uint128));
oracleValue = _firewallMint(_targetPrice, oracleValue, mintDeviation);
oracleValue = _firewallMint(targetPrice, oracleValue, mintDeviation);
}

/// @notice Reads the oracle value that will be used for a burn operation for an asset with `oracleConfig`
@@ -85,29 +84,38 @@ library LibOracle {
ITransmuterOracle externalOracle = abi.decode(oracleData, (ITransmuterOracle));
return externalOracle.readBurn();
}
uint256 _targetPrice = read(targetType, BASE_18, targetData);
oracleValue = read(oracleType, _targetPrice, oracleData);
uint256 targetPrice;
(oracleValue, targetPrice) = readSpotAndTarget(oracleType, targetType, oracleData, targetData);
(, uint128 burnDeviation) = abi.decode(hyperparameters, (uint128, uint128));
ratio = _firewallBurn(_targetPrice, oracleValue, burnDeviation);
ratio = _firewallBurn(targetPrice, oracleValue, burnDeviation);
}

/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VIEW FUNCTIONS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/

/// @notice Internal version of the `getOracle` function
function getOracle(
address collateral
) internal view returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory) {
function getOracle(address collateral)
internal
view
returns (
OracleReadType,
OracleReadType,
bytes memory,
bytes memory,
bytes memory
)
{
return _parseOracleConfig(s.transmuterStorage().collaterals[collateral].oracleConfig);
}

/// @notice Gets the oracle value and the ratio with respect to the target price when it comes to
/// burning for `collateral`
function getBurnOracle(
address collateral,
bytes memory oracleConfig
) internal view returns (uint256 minRatio, uint256 oracleValue) {
function getBurnOracle(address collateral, bytes memory oracleConfig)
internal
view
returns (uint256 minRatio, uint256 oracleValue)
{
TransmuterStorage storage ts = s.transmuterStorage();
minRatio = BASE_18;
address[] memory collateralList = ts.collateralList;
@@ -130,8 +138,22 @@ library LibOracle {
else return baseValue;
}

function readSpotAndTarget(
OracleReadType oracleType,
OracleReadType targetType,
bytes memory oracleData,
bytes memory targetData
) internal view returns (uint256 oracleValue, uint256 targetPrice) {
targetPrice = read(targetType, BASE_18, targetData);
oracleValue = read(oracleType, targetPrice, oracleData);
}

/// @notice Reads an oracle value (or a target oracle value) for an asset based on its data parsed `oracleConfig`
function read(OracleReadType readType, uint256 baseValue, bytes memory data) internal view returns (uint256) {
function read(
OracleReadType readType,
uint256 baseValue,
bytes memory data
) internal view returns (uint256) {
if (readType == OracleReadType.CHAINLINK_FEEDS) {
(
AggregatorV3Interface[] memory circuitChainlink,
@@ -201,8 +223,8 @@ library LibOracle {
(, int256 ratio, , uint256 updatedAt, ) = feed.latestRoundData();
if (ratio <= 0 || block.timestamp - updatedAt > stalePeriod) revert InvalidChainlinkRate();
// Checking whether we should multiply or divide by the ratio computed
if (multiplied == 1) return (_quoteAmount * uint256(ratio)) / (10 ** decimals);
else return (_quoteAmount * (10 ** decimals)) / uint256(ratio);
if (multiplied == 1) return (_quoteAmount * uint256(ratio)) / (10**decimals);
else return (_quoteAmount * (10**decimals)) / uint256(ratio);
}

/// @notice Reads a Pyth fee using a quote amount and converts the quote amount to the `out-currency`
@@ -217,23 +239,35 @@ library LibOracle {
if (pythData.price <= 0) revert InvalidRate();
uint256 normalizedPrice = uint64(pythData.price);
bool isNormalizerExpoNeg = pythData.expo < 0;
uint256 normalizer = isNormalizerExpoNeg ? 10 ** uint32(-pythData.expo) : 10 ** uint32(pythData.expo);
uint256 normalizer = isNormalizerExpoNeg ? 10**uint32(-pythData.expo) : 10**uint32(pythData.expo);
if (multiplied == 1 && isNormalizerExpoNeg) return (_quoteAmount * normalizedPrice) / normalizer;
else if (multiplied == 1 && !isNormalizerExpoNeg) return _quoteAmount * normalizedPrice * normalizer;
else if (multiplied == 0 && isNormalizerExpoNeg) return (_quoteAmount * normalizer) / normalizedPrice;
else return _quoteAmount / (normalizer * normalizedPrice);
}

/// @notice Parses an `oracleConfig` into several sub fields
function _parseOracleConfig(
bytes memory oracleConfig
) private pure returns (OracleReadType, OracleReadType, bytes memory, bytes memory, bytes memory) {
function _parseOracleConfig(bytes memory oracleConfig)
private
pure
returns (
OracleReadType,
OracleReadType,
bytes memory,
bytes memory,
bytes memory
)
{
return abi.decode(oracleConfig, (OracleReadType, OracleReadType, bytes, bytes, bytes));
}

/// @notice Firewall in case the oracle value reported is too high compared to the target
/// --> disregard the oracle value and return the target price
function _firewallMint(uint256 targetPrice, uint256 oracleValue, uint256 deviation) private pure returns (uint256) {
function _firewallMint(
uint256 targetPrice,
uint256 oracleValue,
uint256 deviation
) private pure returns (uint256) {
if (targetPrice * (BASE_18 + deviation) < oracleValue * BASE_18) oracleValue = targetPrice;
sogipec marked this conversation as resolved.
Show resolved Hide resolved
return oracleValue;
}
@@ -251,6 +285,8 @@ library LibOracle {

function updateOracle(address collateral) internal {
TransmuterStorage storage ts = s.transmuterStorage();
if (ts.collaterals[collateral].decimals == 0) revert NotCollateral();

(
OracleReadType oracleType,
OracleReadType targetType,
@@ -259,22 +295,23 @@ library LibOracle {
bytes memory hyperparameters
) = _parseOracleConfig(ts.collaterals[collateral].oracleConfig);

if (targetType != OracleReadType.MAX) return;
if (targetType != OracleReadType.MAX) revert OracleUpdateFailed();

uint256 oracleValue = read(oracleType, BASE_18, oracleData);
(uint256 maxValue, uint96 lastUpdateTimestamp, uint96 deviationThreshold, uint32 heartbeat) = abi.decode(
(uint256 maxValue, uint96 deviationThreshold, uint96 lastUpdateTimestamp, uint32 heartbeat) = abi.decode(
targetData,
(uint256, uint96, uint96, uint32)
);

if (
(oracleValue >= (maxValue * (BASE_18 + deviationThreshold)) / BASE_18) ||
(oracleValue * BASE_18 >= maxValue * (BASE_18 + deviationThreshold)) ||
(block.timestamp - lastUpdateTimestamp > heartbeat)
sogipec marked this conversation as resolved.
Show resolved Hide resolved
) {
ts.collaterals[collateral].oracleConfig = abi.encode(
oracleType,
targetType,
oracleData,
abi.encode(oracleValue, block.timestamp, deviationThreshold, heartbeat),
abi.encode(oracleValue, deviationThreshold, block.timestamp, heartbeat),
hyperparameters
);
} else revert OracleUpdateFailed();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"deploy:fork": "source .env && forge script --skip test --slow --fork-url fork --broadcast scripts/DeploySavingsNoImplem.s.sol -vvvv",
"generate": "FOUNDRY_PROFILE=dev forge script scripts/utils/GenerateSelectors.s.sol",
"deploy:check": "FOUNDRY_PROFILE=dev forge script --fork-url fork scripts/test/CheckTransmuter.s.sol",
"gas": "yarn test --gas-report",
"gas": "FOUNDRY_PROFILE=dev yarn test --gas-report",
"fork": "source .env && anvil --fork-url $ETH_NODE_URI_BASE",
"fork:arbitrum": "source .env && anvil --fork-url $ETH_NODE_URI_ARBITRUM",
"fork:polygon": "source .env && anvil --fork-url $ETH_NODE_URI_POLYGON",
2 changes: 1 addition & 1 deletion scripts/test/CheckFakeTransmuter.s.sol
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ contract CheckFakeTransmuter is Utils {

// Checks all valid selectors are here
bytes4[] memory selectors = _generateSelectors("ITransmuter");
for (uint i = 0; i < selectors.length; ++i) {
for (uint256 i = 0; i < selectors.length; ++i) {
assertEq(transmuter.isValidSelector(selectors[i]), true);
}
assertEq(address(transmuter.accessControlManager()), address(CORE_BORROW));
352 changes: 290 additions & 62 deletions test/fuzz/OracleTest.t.sol

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions test/utils/Transmuter.sol
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ import { DiamondCut } from "contracts/transmuter/facets/DiamondCut.sol";
import { DiamondEtherscan } from "contracts/transmuter/facets/DiamondEtherscan.sol";
import { DiamondLoupe } from "contracts/transmuter/facets/DiamondLoupe.sol";
import { Getters } from "contracts/transmuter/facets/Getters.sol";
import { Oracle } from "contracts/transmuter/facets/Oracle.sol";
import { Redeemer } from "contracts/transmuter/facets/Redeemer.sol";
import { RewardHandler } from "contracts/transmuter/facets/RewardHandler.sol";
import { SettersGovernor } from "contracts/transmuter/facets/SettersGovernor.sol";
@@ -42,6 +43,9 @@ abstract contract Transmuter is Helper {
facetNames.push("Getters");
facetAddressList.push(address(new Getters()));

facetNames.push("Oracle");
facetAddressList.push(address(new Oracle()));

facetNames.push("Redeemer");
facetAddressList.push(address(new Redeemer()));

@@ -73,10 +77,11 @@ abstract contract Transmuter is Helper {
}

// @dev Deploys diamond and connects facets
function deployReplicaTransmuter(
address _init,
bytes memory _calldata
) public virtual returns (ITransmuter _transmuter) {
function deployReplicaTransmuter(address _init, bytes memory _calldata)
public
virtual
returns (ITransmuter _transmuter)
{
// Build appropriate payload
uint256 n = facetNames.length;
FacetCut[] memory cut = new FacetCut[](n);

Unchanged files with check annotations Beta

pragma solidity ^0.8.19;
import { IERC20 } from "oz/interfaces/IERC20.sol";
import { IERC20Metadata } from "oz/interfaces/IERC20Metadata.sol";

Check warning on line 6 in contracts/helpers/Rebalancer.sol

GitHub Actions / lint

imported name IERC20Metadata is not used
import { SafeERC20 } from "oz/token/ERC20/utils/SafeERC20.sol";
import { SafeCast } from "oz/utils/math/SafeCast.sol";
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0;

Check warning on line 3 in contracts/interfaces/ISetters.sol

GitHub Actions / lint

Found more than One contract per file. 2 contracts found!
import { IERC20 } from "oz/interfaces/IERC20.sol";
import "oz/interfaces/IERC20.sol";
import "oz/token/ERC20/utils/SafeERC20.sol";
import { IAgToken } from "interfaces/IAgToken.sol";

Check warning on line 42 in contracts/savings/BaseSavings.sol

GitHub Actions / lint

imported name IAgToken is not used
import { AccessControl, IAccessControlManager } from "../utils/AccessControl.sol";

Check warning on line 44 in contracts/savings/BaseSavings.sol

GitHub Actions / lint

imported name IAccessControlManager is not used
import "../utils/Constants.sol";
import "../utils/Errors.sol";
address[] memory _collateralAddresses,
address[] memory _oracleAddresses
) external {
uint256 BPS = 1e14;

Check warning on line 31 in contracts/transmuter/configs/FakeGnosis.sol

GitHub Actions / lint

Variable name must be in mixedCase
// Fee structure
uint64[] memory xMintFee = new uint64[](4);
address _agToken,
address dummyImplementation
) external {
uint256 BPS = 1e14;

Check warning on line 16 in contracts/transmuter/configs/Production.sol

GitHub Actions / lint

Variable name must be in mixedCase
address euroc = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;
address bc3m = 0x2F123cF3F37CE3328CC9B5b8415f9EC5109b45e7;
require(address(_accessControlManager) == 0x5bc6BEf80DA563EBf6Df6D6913513fa9A7ec89BE);

Check warning on line 19 in contracts/transmuter/configs/Production.sol

GitHub Actions / lint

Use Custom Errors instead of require statements
require(address(_agToken) == 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8);

Check warning on line 20 in contracts/transmuter/configs/Production.sol

GitHub Actions / lint

Use Custom Errors instead of require statements
// Check this docs for simulations:
// https://docs.google.com/spreadsheets/d/1UxS1m4sG8j2Lv02wONYJNkF4S7NDLv-5iyAzFAFTfXw/edit#gid=0
import "interfaces/external/chainlink/AggregatorV3Interface.sol";
import { LibDiamondEtherscan } from "../libraries/LibDiamondEtherscan.sol";

Check warning on line 7 in contracts/transmuter/configs/ProductionTypes.sol

GitHub Actions / lint

imported name LibDiamondEtherscan is not used
import "../libraries/LibOracle.sol";
import { LibSetters } from "../libraries/LibSetters.sol";

Check warning on line 9 in contracts/transmuter/configs/ProductionTypes.sol

GitHub Actions / lint

imported name LibSetters is not used
import { LibStorage as s } from "../libraries/LibStorage.sol";
import { DummyDiamondImplementation } from "../../../scripts/generated/DummyDiamondImplementation.sol";