Skip to content

Commit

Permalink
Merge pull request #58 from liquity/initial_tests
Browse files Browse the repository at this point in the history
Initial tests
  • Loading branch information
bingen authored Jan 18, 2024
2 parents f561637 + 261b16c commit d1570dc
Show file tree
Hide file tree
Showing 44 changed files with 51,205 additions and 1 deletion.
4 changes: 4 additions & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ docs/

# Dotenv file
.env

artifacts
cache_hardhat
node_modules
27 changes: 26 additions & 1 deletion contracts/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
require("@nomicfoundation/hardhat-foundry");
require("@nomicfoundation/hardhat-toolbox");
require("@nomiclabs/hardhat-truffle5");

const accounts = require("./hardhatAccountsList2k.js");
const accountsList = accounts.accountsList;

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.19",
solidity: {
compilers: [
{
version: "0.8.18",
settings: {
optimizer: {
enabled: true,
runs: 100,
},
},
},
],
},
networks: {
hardhat: {
accounts: accountsList,
gas: 10000000,
blockGasLimit: 15000000,
gasPrice: 20000000000,
initialBaseFeePerGas: 0,
},
},
};
2,008 changes: 2,008 additions & 0 deletions contracts/hardhatAccountsList2k.js

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions contracts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "bold",
"version": "1.0.0",
"description": "Bold decentralized stablecoin",
"main": "index.js",
"directories": {
"lib": "lib"
},
"scripts": {
"test": "hardhat test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/liquity/bold.git"
},
"author": "Liquity AG",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/liquity/bold/issues"
},
"homepage": "https://github.com/liquity/bold#readme",
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.0",
"@nomicfoundation/hardhat-foundry": "^1.0.1",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox": "^2.0.2",
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^3.0.0",
"@nomiclabs/hardhat-truffle5": "^2.0.7",
"@nomiclabs/hardhat-web3": "^2.0.0",
"@openzeppelin/contracts": "^4.9.3",
"@openzeppelin/test-helpers": "^0.5.16",
"@typechain/ethers-v5": "^10.1.0",
"@typechain/hardhat": "^6.1.2",
"@types/chai": "^4.2.0",
"@types/mocha": ">=9.1.0",
"chai": "^4.2.0",
"decimal.js": "^10.4.3",
"hardhat": "^2.14.0",
"hardhat-gas-reporter": "^1.0.8",
"solidity-coverage": "^0.8.1",
"ts-node": ">=8.0.0",
"typechain": "^8.1.0",
"typescript": ">=4.5.0"
}
}
3 changes: 3 additions & 0 deletions contracts/src/BorrowerOperations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import "./Dependencies/LiquityBase.sol";
import "./Dependencies/Ownable.sol";
import "./Dependencies/CheckContract.sol";

//import "forge-std/console.sol";


contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOperations {
string constant public NAME = "BorrowerOperations";

Expand Down
11 changes: 11 additions & 0 deletions contracts/src/test/TestContracts/CommunityIssuanceMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.18;

contract CommunityIssuanceMock {
function setAddresses(address _lqtyTokenAddress, address _stabilityPoolAddress) external {}

function issueLQTY() external returns (uint) {}

function sendLQTY(address _account, uint _LQTYamount) external {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pragma solidity ^0.8.18;

import "../../../Interfaces/IPriceFeed.sol";


interface IPriceFeedMock is IPriceFeed {
function setPrice(uint256 _price) external;
}
26 changes: 26 additions & 0 deletions contracts/src/test/TestContracts/LQTYStakingMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.18;

contract LQTYStakingMock {
function setAddresses
(
address _lqtyTokenAddress,
address _boldTokenAddress,
address _troveManagerAddress,
address _borrowerOperationsAddress,
address _activePoolAddress
) external {}

function stake(uint _LQTYamount) external {}

function unstake(uint _LQTYamount) external {}

function increaseF_ETH(uint _ETHFee) external {}

function increaseF_bold(uint _LQTYFee) external {}

function getPendingETHGain(address _user) external view returns (uint) {}

function getPendingBoldGain(address _user) external view returns (uint) {}
}
15 changes: 15 additions & 0 deletions contracts/src/test/TestContracts/LQTYTokenMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.18;

//import "../../Dependencies/IERC20.sol";
//import "../../Dependencies/IERC2612.sol";


contract LQTYTokenMock /*is IERC20, IERC2612*/ {
function sendToLQTYStaking(address _sender, uint256 _amount) external {}

function getDeploymentStartTime() external view returns (uint256) {}

function getLpRewardsEntitlement() external view returns (uint256) {}
}
21 changes: 21 additions & 0 deletions contracts/src/test/TestContracts/PriceFeedMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pragma solidity 0.8.18;

import "./Interfaces/IPriceFeedMock.sol";
import "../../PriceFeed.sol";


contract PriceFeedMock is IPriceFeedMock {
uint256 private PRICE;

function setPrice(uint256 _price) external {
PRICE = _price;
}

function getPrice() external view returns (uint256 _price) {
return PRICE;
}

function fetchPrice() external view returns (uint256) {
return PRICE;
}
}
Loading

0 comments on commit d1570dc

Please sign in to comment.