Skip to content

335 referral system#197

Open
quent043 wants to merge 100 commits intomainfrom
335-referral_system
Open

335 referral system#197
quent043 wants to merge 100 commits intomainfrom
335-referral_system

Conversation

@quent043
Copy link
Copy Markdown
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 added 2 commits May 30, 2023 17:21
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
@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 <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
& fixed a bug

Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Updated tests

Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Added new events tests

Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Added test assertion

Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
@quent043 quent043 added the NEED REVIEW Dev is waiting for peer review label Jun 19, 2023
ProposalStatus status,
address rateToken,
uint256 rateAmount,
uint256 amount,
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

quent043 added 11 commits June 20, 2023 09:10
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
"c980df0f3f2d12ed5c153d563a1fbbb3da4380540f0f81a91a88015668a2090b": {
"address": "0xB60f8b4f06B66ecc75806cC5bbfc17b6eF8e56D7",
"txHash": "0xbe5bd8de2d13887a8f6109045d69507b8ab9e16cb1875656b2ca746af012603f",
"452eb25e1c135f95b329252e20212c01eb69015592373af7097bb11bb44a9ae1": {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

quent043 added 11 commits July 26, 2023 11:31
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
Signed-off-by: Quentin D.C <quent043@hotmail.com>
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