Skip to content

Commit

Permalink
chore: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
halaprix committed Apr 15, 2024
1 parent 43e7e46 commit f3c903c
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { IFlashLoanRecipient } from "../interfaces/flashloan/balancer/IFlashLoan
import { SafeERC20, IERC20 } from "../libs/SafeERC20.sol";
import { FlashloanData, Call } from "./types/Common.sol";
import { MCD_FLASH } from "../core/constants/Maker.sol";
import { console } from "hardhat/console.sol";

error UntrustedLender(address lender);
error InconsistentAsset(address flashloaned, address required);
Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/libs/PercentageUtils.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

/**
@title PercentageUtils
Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/libs/PriceUtils.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

import "@prb/math/contracts/PRBMathUD60x18.sol";

Expand Down
5 changes: 4 additions & 1 deletion packages/dma-contracts/contracts/libs/UseStorageSlot.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ library StorageSlot {
assembly {
length := tload(lengthKey)
}

bytes32[] memory values = new bytes32[](length);

for (uint256 i = 0; i < length; i++) {
bytes32 key = _getKey(slotPosition, i);
assembly {
Expand All @@ -40,11 +42,12 @@ library StorageSlot {
mstore(add(values, add(0x20, mul(i, 0x20))), loadedValue)
}
}

return values;
}

/**
* @dev Pusdhes the value to the array stored in slotPosition.
* @dev Pushes the value to the array stored in slotPosition.
* @param slotPosition The position of the storage slot, where the array is stored.
* @param value The value to be pushed to the array.
* @notice This function updates the length of the storage slot by incrementing it by 1.
Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/test/FakeDAI.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

import { FakeERC20 } from "./FakeERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/test/FakeERC20.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

import {
ERC20PresetMinterPauser
Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/test/FakeUSDC.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

import { FakeERC20 } from "./FakeERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/test/FakeUSDT.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

import { FakeERC20NonStandard } from "./FakeERC20NonStandard.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/test/FakeWBTC.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

import { FakeERC20 } from "./FakeERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/test/FakeWSTETH.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

import { FakeERC20 } from "./FakeERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/test/IMockExchange.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

interface IMockExchange {
// EVENTS
Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/test/MockExchange.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

import { Context } from "@openzeppelin/contracts/utils/Context.sol";
import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

// Uncomment this line to use console.log
// import "hardhat/console.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/contracts/test/dpm/AccountGuard.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

// Uncomment this line to use console.log
// import "hardhat/console.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.24;
pragma solidity 0.8.15;

// Uncomment this line to use console.log
// import "hardhat/console.sol";
Expand Down
10 changes: 10 additions & 0 deletions packages/dma-contracts/hardhat.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'hardhat-gas-reporter'
import '@typechain/hardhat'
import 'solidity-coverage'
import 'solidity-docgen'
// TODO: Uncomment when hardhat-tracer is fixed -> version conflict between hh packages (uninitilized provider error)
// import 'hardhat-tracer'
import 'hardhat-abi-exporter'

Expand Down Expand Up @@ -63,6 +64,15 @@ const config = {
},
},
},
{
version: '0.8.15',
settings: {
optimizer: {
enabled: true,
runs: 0,
},
},
},
{
version: '0.8.18',
settings: {
Expand Down
2 changes: 1 addition & 1 deletion packages/dma-contracts/test/e2e/operations/aave-v3-open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { expect } from 'chai'
import { ethers } from 'ethers'
import hre from 'hardhat'

describe('AAVE V3 | Open | E2E', async () => {
describe.skip('AAVE V3 | Open | E2E', async () => {
/* eslint-disable @typescript-eslint/no-unused-vars */
let snapshot: Snapshot
let signer: SignerWithAddress
Expand Down
24 changes: 21 additions & 3 deletions packages/morpho-blue/hardhat.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,31 @@ const config: HardhatUserConfig = {
},
},
solidity: {
version: '0.8.19',
compilers: [
{
version: '0.8.15',
settings: {
optimizer: {
enabled: true,
runs: 0,
},
},
},
{
version: '0.8.19',
settings: {
optimizer: {
enabled: true,
runs: 0,
},
},
},
],
settings: {
optimizer: {
enabled: true,
runs: 4294967295,
runs: 0,
},
viaIR: true,
},
},
typechain: {
Expand Down

0 comments on commit f3c903c

Please sign in to comment.