1

so I have the following function in my smart contract:

 function proxy(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) {

        callData = data;
        (bool success, bytes memory returnData) = target.call.value(value)(callData);
        ...
    }

This function is just a proxy that calls another function in another smart contract, that function accepts many parameters.

This is my web3

 const txHash = await timelockContract.methods.proxy("0xF759Deb538aeEe26842b2cf37a9eB5A3687f8f23",
    0,
    "otherFunctionInOtherSmartContractfunctionCall(uint256, uint256)",
    BYTES PARAMETERS,
    1618335100
    ).send({from: "0x8077931197c1F0a1047c1d066d937931EAB4C5Dd"});

So, where 'BYTES PARAMETERS' is, goes the parameters for the function, so I have to send 2 parameters as bytes, but I dont find a way, from what I've read, you can convert to bytes using the following function:

web3.utils.asciiToHex()

But how can I send two parameters or more as bytes?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.