DlnDestination smart contract performs standard routine procedures, including checking that the order is still open
(neither Fulfilled nor Cancelled) and that the requested amount of tokens were successfully pulled from the solver. Finally, it transfers the
requested amount of tokens to the order’s recipient address, OR — if the hook raw data is provided — to the DlnExternalCallAdapter hook engine smart
contract address (accessible via DlnDestination.externalCallAdapter), immediately invoking it for hook handling.
DlnExternalCallAdapter is responsible for proper hook raw data decoding, hook execution, and guaranties that hook behavior conforms given
properties.
Hook data V1 layout
DlnExternalCallAdapter expects the hook raw data (called externalCallEnvelope) to be an concatenation of two encodePacked’d data types, specifically:- first byte:
uint8 envelopeVersion - subsequent bytes:
bytes envelopeData
envelopeVersion determines which data structure was used to encode the envelopeData.
Envelope v1
TheenvelopeVersion=1 is currently the only available version, and its corresponding structure for the envelopeData is HookDataV1 as follows:
IExternalCallExecutor
IExternalCallExecutor