Skip to content

Conversation

@nicholaspai
Copy link
Member

Allows a whitelisted account to claim on behalf of a user. Can be used to atomically claim and perform some action for a user, such as claim and stake.

Allows a whitelisted account to claim on behalf of a user. Can be used to atomically claim and perform some action for a user, such as claim and stake.
@nicholaspai nicholaspai marked this pull request as ready for review November 2, 2022 19:44
@nicholaspai nicholaspai requested a review from pxrl November 2, 2022 20:51
Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM!

require(whitelistedClaimers[msg.sender] || _claim.account == msg.sender, "invalid claimer");
super.claim(_claim);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this should be done in a separate PR, but it's a little confusing that whitelisted claimers can claim directly to their own address and call claimMulti to send tokens to the user.

If we end up going in this direction, do you think we should drop the overridden claimMulti and claim methods, just to reduce surface area and complexity?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we still need to require that the claim.account is the caller so users can't reset each other's referral multipliers but i can remove the whitelist requirement. Thats more so to make testing easier but there's an easier way to do this

Copy link
Member Author

Choose a reason for hiding this comment

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

Implemented the change where the whitelist only applies for claimFor: e21526a

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, that makes sense!

@nicholaspai nicholaspai requested a review from mrice32 November 2, 2022 23:00
Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM!

require(whitelistedClaimers[msg.sender] || _claim.account == msg.sender, "invalid claimer");
super.claim(_claim);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, that makes sense!

@nicholaspai nicholaspai merged commit 708669a into master Nov 3, 2022
@nicholaspai nicholaspai deleted the npai/md-deployments branch November 3, 2022 12:31
require(claims[i].account == msg.sender, "invalid claimer");
}
uint256 claimCount = claims.length;
for (uint256 i = 0; i < claimCount; i++) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Undoes changes in https://github.com/across-protocol/contracts-v2/pull/195/files that allow a whitelisted claimer to claim on behalf of claimer

* @param _claim leaf to claim.
*/

function claimFor(Claim memory _claim) public {
Copy link
Member Author

Choose a reason for hiding this comment

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

New claimFor method that whitelisted claimer can call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants