-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: main
Are you sure you want to change the base?
335 referral system #197
Conversation
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]>
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]>
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]>
Signed-off-by: Quentin D.C <[email protected]>
Updated tests Signed-off-by: Quentin D.C <[email protected]>
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]>
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]>
Signed-off-by: Quentin D.C <[email protected]>
Signed-off-by: Quentin D.C <[email protected]>
contracts/TalentLayerService.sol
Outdated
*/ | ||
event ProposalCreated( | ||
uint256 serviceId, | ||
uint256 ownerId, | ||
string dataUri, | ||
ProposalStatus status, | ||
address rateToken, | ||
uint256 rateAmount, | ||
uint256 amount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rateAmount
contracts/TalentLayerService.sol
Outdated
address rateToken, | ||
uint256 rateAmount, | ||
uint256 expirationDate | ||
uint256 amount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rateAmount
contracts/TalentLayerEscrow.sol
Outdated
*/ | ||
function getClaimableReferralBalance(address _token) external view returns (uint256 balance) { | ||
uint256 referrerId = talentLayerIdContract.ids(_msgSender()); | ||
talentLayerIdContract.isValid(referrerId); |
There was a problem hiding this comment.
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
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]>
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]>
.openzeppelin/polygon-mumbai.json
Outdated
"c980df0f3f2d12ed5c153d563a1fbbb3da4380540f0f81a91a88015668a2090b": { | ||
"address": "0xB60f8b4f06B66ecc75806cC5bbfc17b6eF8e56D7", | ||
"txHash": "0xbe5bd8de2d13887a8f6109045d69507b8ab9e16cb1875656b2ca746af012603f", | ||
"452eb25e1c135f95b329252e20212c01eb69015592373af7097bb11bb44a9ae1": { |
There was a problem hiding this comment.
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
contracts/TalentLayerEscrow.sol
Outdated
* @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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BalanceTransferred ?
contracts/TalentLayerEscrow.sol
Outdated
) private view returns (uint256 totalEscrowAmount) { | ||
return | ||
totalEscrowAmount = | ||
_amount + |
There was a problem hiding this comment.
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
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]>
New PR:
Useful info
Auto-Review checklist
Typing
npm run lint
npm run format