Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

335 referral system #197

Open
wants to merge 100 commits into
base: main
Choose a base branch
from
Open

335 referral system #197

wants to merge 100 commits into from

Conversation

quent043
Copy link
Contributor

New PR:

Useful info

  • Trello:
  • Description:

Auto-Review checklist

  • Check if there is no merge conflict
  • If you have new .env variable, check if you add it in the .env.example file

Typing

  • Check lint feedbacks: npm run lint
  • Check prettier format feedbacks: npm run format

@quent043 quent043 requested a review from 0xRomain May 30, 2023 16:25
quent043 added 27 commits May 31, 2023 14:39
Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
& fixed a bug

Signed-off-by: Quentin D.C <[email protected]>
Updated tests

Signed-off-by: Quentin D.C <[email protected]>
Added new events tests

Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
Added test assertion

Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
@quent043 quent043 added the NEED REVIEW Dev is waiting for peer review label Jun 19, 2023
*/
event ProposalCreated(
uint256 serviceId,
uint256 ownerId,
string dataUri,
ProposalStatus status,
address rateToken,
uint256 rateAmount,
uint256 amount,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rateAmount

address rateToken,
uint256 rateAmount,
uint256 expirationDate
uint256 amount,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rateAmount

*/
function getClaimableReferralBalance(address _token) external view returns (uint256 balance) {
uint256 referrerId = talentLayerIdContract.ids(_msgSender());
talentLayerIdContract.isValid(referrerId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not need to do isValid, will return 0 if not valid

"c980df0f3f2d12ed5c153d563a1fbbb3da4380540f0f81a91a88015668a2090b": {
"address": "0xB60f8b4f06B66ecc75806cC5bbfc17b6eF8e56D7",
"txHash": "0xbe5bd8de2d13887a8f6109045d69507b8ab9e16cb1875656b2ca746af012603f",
"452eb25e1c135f95b329252e20212c01eb69015592373af7097bb11bb44a9ae1": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these updates must not be pushed unless it's the official Mumbai contracts of TL

* @notice Allows a referrer to claim its tokens & / or ETH balance.
* @param _referrerId The ID of the referrer claiming the balance.
* @param _tokenAddress The address of the Token contract (address(0) if balance in ETH).
* @dev Emits a BalanceTransferred & a ReferralAmountClaimed events
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BalanceTransferred ?

) private view returns (uint256 totalEscrowAmount) {
return
totalEscrowAmount =
_amount +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realize there is an issue here. The system can only work if we are taking the same fees that we do today on the _amount, for the _referralAmount. With fees it becomes sybil resistant
So here, _originServiceFeeRate, _originValidatedProposalFeeRate and _originValidatedProposalFeeRate should be applied to _referralAmount

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NEED REVIEW Dev is waiting for peer review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants