Skip to content

Commit 14fed4d

Browse files
hal909feewet
andcommitted
Truefi 2.0 deploy (#505)
* rating agency v2 distributor * truefi 2.0 deploy * linter * fix test * add docs * flatten * linter * documentation Co-authored-by: Hal Hyatt <[email protected]>
1 parent 0cfcd50 commit 14fed4d

File tree

153 files changed

+10881
-1288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+10881
-1288
lines changed

contracts/truefi/LoanFactory.sol

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ contract LoanFactory is ILoanFactory, Initializable {
4343
currencyToken = _currencyToken;
4444
}
4545

46+
/** @dev sets lender address **/
4647
function setLender() external {
4748
lender = 0x16d02Dc67EB237C387023339356b25d1D54b0922;
4849
}
4950

51+
/** @dev sets liquidator address **/
5052
function setLiquidator() external {
51-
liquidator = address(0); // to be changed for deployment
53+
liquidator = 0x76dd4921C99AC6b61b3a98f9fa6f181cA6D70c77;
5254
}
5355

5456
/**

contracts/truefi/TrueRatingAgencyV2.sol

+6
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,19 @@ contract TrueRatingAgencyV2 is ITrueRatingAgencyV2, Ownable {
312312
emit Rated(id, msg.sender, choice, stake);
313313
}
314314

315+
/**
316+
* @dev Internal function to help reset ratings
317+
* @param id Loan ID
318+
* @param choice Boolean representing choice
319+
*/
315320
function _resetCastRatings(address id, bool choice) internal {
316321
loans[id].prediction[choice] = loans[id].prediction[choice].sub(loans[id].ratings[msg.sender][choice]);
317322
loans[id].ratings[msg.sender][choice] = 0;
318323
}
319324

320325
/**
321326
* @dev Cancel ratings of msg.sender
327+
* @param id ID to cancel ratings for
322328
*/
323329
function resetCastRatings(address id) public onlyPendingLoans(id) {
324330
if (getYesRate(id, msg.sender) > 0) {

contracts/truefi/distributors/ArbitraryDistributor.sol

+6-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ contract ArbitraryDistributor is IArbitraryDistributor, Ownable {
6464
_;
6565
}
6666

67-
function setBeneficiaryStatus(address _beneficiary, bool _status) public {
67+
/**
68+
* @dev Set beneficiary status
69+
* @param _beneficiary Contract which can claim TRU
70+
* @param _status Boolean to set whether beneficiary can claim TRU
71+
*/
72+
function setBeneficiaryStatus(address _beneficiary, bool _status) public onlyOwner {
6873
beneficiaries[_beneficiary] = _status;
6974
emit BeneficiaryStatusChanged(_beneficiary, _status);
7075
}

contracts/truefi/distributors/RatingAgencyV2Distributor.sol

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,8 @@ contract RatingAgencyV2Distributor is IArbitraryDistributor, Ownable {
4040
* @dev Initialize distributor
4141
* @param _beneficiary Address for distribution
4242
* @param _trustToken TRU address
43-
* @param _amount Amount to distribute
4443
*/
45-
function initialize(
46-
address _beneficiary,
47-
IERC20 _trustToken,
48-
uint256 _amount
49-
) public initializer {
44+
function initialize(address _beneficiary, IERC20 _trustToken) public initializer {
5045
Ownable.initialize();
5146
trustToken = _trustToken;
5247
beneficiary = _beneficiary;
@@ -64,7 +59,12 @@ contract RatingAgencyV2Distributor is IArbitraryDistributor, Ownable {
6459
_;
6560
}
6661

67-
function setBeneficiaryStatus(address _beneficiary, bool _status) public {
62+
/**
63+
* @dev Owner can set beneficiary status
64+
* @param _beneficiary Contract which can claim TRU
65+
* @param _status Boolean to set whether contract can claim TRU
66+
*/
67+
function setBeneficiaryStatus(address _beneficiary, bool _status) public onlyOwner {
6868
beneficiaries[_beneficiary] = _status;
6969
emit BeneficiaryStatusChanged(_beneficiary, _status);
7070
}

0 commit comments

Comments
 (0)