blockful-io / external-resolver

This project aims to scale the Ethereum Name Service (ENS) by consolidating existing patterns and proofs of concept into a unified and production-ready codebase.
MIT License
14 stars 3 forks source link

Multicall with no specific implementation #148

Closed pikonha closed 2 months ago

pikonha commented 3 months ago

Refactor Request

Describe the Refactor Request

The current multicall implementation required an specific handling on the client side:

function multicall(bytes[] calldata datas)
    external
    returns (bytes[] memory /* results */ )
{
    IWriteDeferral.parameter[] memory params =
        new IWriteDeferral.parameter[](1);

    params[0].name = "data";
    params[0].value = TypeToString.bytesToString(msg.data);

    _offChainStorage(params);
}

client handling:

  let callData
  if (multicall) {
    callData = message.parameters[0].value as `0x${string}`
  } else {
    callData = encodeFunctionData({
      abi: dbABI,
      functionName: message.functionSelector,
      args: message.parameters.map((arg) => arg.value),
    })
  }

This happens because of a limitation of the EIP-5559 due to an intermediary structure called parameters that has key and value both as strings to store function arguments.

Describe Preferred Solution

Find a way to handle the multicall the same way as the other calls so the client doesn't need to implement specific handling.

Describe Alternatives

change EIP-5559

Related Code

Additional Context

pikonha commented 3 months ago

blocked til the changes of the EIP-5559 are accepted by the community

pikonha commented 2 months ago

closed by #179