-
Notifications
You must be signed in to change notification settings - Fork 10
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 #58 from liquity/initial_tests
Initial tests
- Loading branch information
Showing
44 changed files
with
51,205 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ docs/ | |
|
||
# Dotenv file | ||
.env | ||
|
||
artifacts | ||
cache_hardhat | ||
node_modules |
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 |
---|---|---|
@@ -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, | ||
}, | ||
}, | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
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,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" | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
contracts/src/test/TestContracts/CommunityIssuanceMock.sol
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,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 {} | ||
} |
8 changes: 8 additions & 0 deletions
8
contracts/src/test/TestContracts/Interfaces/IPriceFeedMock.sol
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,8 @@ | ||
pragma solidity ^0.8.18; | ||
|
||
import "../../../Interfaces/IPriceFeed.sol"; | ||
|
||
|
||
interface IPriceFeedMock is IPriceFeed { | ||
function setPrice(uint256 _price) external; | ||
} |
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,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) {} | ||
} |
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,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) {} | ||
} |
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,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; | ||
} | ||
} |
Oops, something went wrong.