Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin D.C <[email protected]>
  • Loading branch information
quent043 committed Nov 26, 2023
2 parents 7f84e7a + dd56c83 commit cf3b865
Show file tree
Hide file tree
Showing 11 changed files with 1,085 additions and 13 deletions.
13 changes: 11 additions & 2 deletions contracts/TalentLayerEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,15 @@ contract TalentLayerEscrow is
* @param _token The address of the token used for the payment.
* @param _amount The amount paid.
* @param _serviceId The id of the concerned service.
* @param _proposalId The id of the corresponding proposal.
*/
event Payment(
uint256 _transactionId,
PaymentType _paymentType,
address _token,
uint256 _amount,
uint256 _serviceId
uint256 _serviceId,
uint256 _proposalId
);

/**
Expand Down Expand Up @@ -1075,7 +1077,14 @@ contract TalentLayerEscrow is
*/
function _afterPayment(uint256 _transactionId, PaymentType _paymentType, uint256 _releaseAmount) private {
Transaction storage transaction = transactions[_transactionId];
emit Payment(transaction.id, _paymentType, transaction.token, _releaseAmount, transaction.serviceId);
emit Payment(
transaction.id,
_paymentType,
transaction.token,
_releaseAmount,
transaction.serviceId,
transaction.proposalId
);

if (transaction.amount == 0) {
talentLayerServiceContract.afterFullPayment(transaction.serviceId, transaction.releasedAmount);
Expand Down
15 changes: 15 additions & 0 deletions contracts/TalentLayerPlatformID.sol
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ contract TalentLayerPlatformID is ERC721Upgradeable, AccessControlUpgradeable, U
function addArbitrator(address _arbitrator, bool _isInternal) public onlyRole(DEFAULT_ADMIN_ROLE) {
validArbitrators[address(_arbitrator)] = true;
internalArbitrators[address(_arbitrator)] = _isInternal;
emit ArbitratorAdded(_arbitrator, _isInternal);
}

/**
Expand All @@ -429,6 +430,7 @@ contract TalentLayerPlatformID is ERC721Upgradeable, AccessControlUpgradeable, U
function removeArbitrator(address _arbitrator) public onlyRole(DEFAULT_ADMIN_ROLE) {
validArbitrators[address(_arbitrator)] = false;
internalArbitrators[address(_arbitrator)] = false;
emit ArbitratorRemoved(_arbitrator);
}

/**
Expand Down Expand Up @@ -638,6 +640,19 @@ contract TalentLayerPlatformID is ERC721Upgradeable, AccessControlUpgradeable, U
*/
event OriginValidatedProposalFeeRateUpdated(uint256 platformId, uint16 originValidatedProposalFeeRate);

/**
* @notice Emit after the arbitrator is added
* @param arbitrator The address of the new arbitrator
* @param isInternal Boolean denoting if the arbitrator is internal (is part of TalentLayer) or not
*/
event ArbitratorAdded(address arbitrator, bool isInternal);

/**
* @notice Emit after the arbitrator is removed
* @param arbitrator The address of the arbitrator
*/
event ArbitratorRemoved(address arbitrator);

/**
* @notice Emit after the arbitrator is updated for a platform
* @param platformId The Platform Id
Expand Down
8 changes: 6 additions & 2 deletions contracts/TalentLayerReview.sol
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ contract TalentLayerReview is ERC2771RecipientUpgradeable, ERC721Upgradeable, UU
uint256 reviewId = nextReviewId.current();
nextReviewId.increment();

ITalentLayerService.Service memory service = talentLayerService.getService(_serviceId);

reviews[reviewId] = Review({
id: reviewId,
ownerId: _to,
Expand All @@ -173,7 +175,7 @@ contract TalentLayerReview is ERC2771RecipientUpgradeable, ERC721Upgradeable, UU
rating: _rating
});

emit Mint(_serviceId, _to, reviewId, _rating, _reviewUri);
emit Mint(_serviceId, _to, reviewId, _rating, _reviewUri, service.acceptedProposalId);
return reviewId;
}

Expand Down Expand Up @@ -271,12 +273,14 @@ contract TalentLayerReview is ERC2771RecipientUpgradeable, ERC721Upgradeable, UU
* @param tokenId The ID of the review token
* @param rating The rating of the review
* @param reviewUri The IPFS URI of the review metadata
* @param proposalId The id of the corresponding proposal.
*/
event Mint(
uint256 indexed serviceId,
uint256 indexed toId,
uint256 indexed tokenId,
uint256 rating,
string reviewUri
string reviewUri,
uint256 proposalId
);
}
Loading

0 comments on commit cf3b865

Please sign in to comment.