Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Set 0 as value to send to actors and add param to handle specific methods #217

Merged
merged 3 commits into from
Feb 8, 2023

Conversation

emmanuelm41
Copy link
Member

@emmanuelm41 emmanuelm41 commented Feb 8, 2023

closes #185

馃敆 zboto Link

Copy link
Contributor

@raulk raulk left a comment

Choose a reason for hiding this comment

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

Cursory look seems fine (not a thorough review).

contracts/v0.8/MarketAPI.sol Show resolved Hide resolved
Comment on lines +83 to 88
function universalReceiverHook(VerifRegTypes.UniversalReceiverParams memory params) internal returns (VerifRegTypes.AllocationsResponse memory) {
bytes memory raw_request = params.serializeUniversalReceiverParams();

bytes memory raw_response = Actor.call(
VerifRegTypes.UniversalReceiverMethodNum,
VerifRegTypes.ActorID,
raw_request,
Misc.CBOR_CODEC,
msg.value,
false
);
bytes memory raw_response = Actor.call(VerifRegTypes.UniversalReceiverMethodNum, VerifRegTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);

bytes memory result = Actor.readRespData(raw_response);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need this method here at all. AFAIK, this is used by some standards to validate that the contract can receive tokens, but it does not need to be exposed to the user on a specific actor. If anything, I would create a helper function that allows the dev to call the universal receiver hook on any address they choose.

Copy link
Member Author

Choose a reason for hiding this comment

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

The function was marked to be exported as far as I remember. We can remove it in another PR if necessary though.

@emmanuelm41 emmanuelm41 merged commit d66e1a1 into master Feb 8, 2023
@emmanuelm41 emmanuelm41 deleted the feat/values-to-send branch February 8, 2023 19:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create new parameter for methods that needs to move funds
2 participants