# How to prepare parameters for executeCall

By [N00b21337](https://paragraph.com/@n00b21337) · 2023-06-10

---

![](https://storage.googleapis.com/papyrus_images/d9317de79ba9501a549e8f6e006e3b4948dd3d0b9c1f0f4c15fb8dc30cc56c4d.png)

How to encode function with parameters and execute it within solidity **executeCall**

Lets start with this example for safeTransferFrom function and its parameters. Go to remix and add this code, then compile it

    // SPDX-License-Identifier: BSD-3-Clause
    pragma solidity ^0.8.17;
    
    contract Encode {
            address from = 0x55C21585007bC89202Bc7eed9B315c8eaB4190A8;
            address to = 0xB1620c0547744DeDD30F40a863c09D1964532F8C;
            uint id = 1;
    
    function encodeWithSignature(
        ) external returns (bytes memory) {
            return abi.encodeWithSignature("safeTransferFrom(address,address,uint256)", from, to, id);
        }
    }
    

Replace parameters in **encodeWithSignature** with your function that you want to call and parameters used in it.

Output of above will be following bytecode

`0x42842e0e00000000000000000000000055c21585007bc89202bc7eed9b315c8eab4190a8000000000000000000000000b1620c0547744dedd30f40a863c09d1964532f8c0000000000000000000000000000000000000000000000000000000000000001`

With that code you can go to etherscan and fill data for executeCall like below.

First field is **ether value** you want to send to the contract where you are calling executeCall (as its payable function), **to** field is what external contract address you want to call, then there is **value** field and that is amount of ether you want to send to that external contract. Finally **data** is where you pass that generated bytecode. Make a **write** and this will be executed

![](https://storage.googleapis.com/papyrus_images/b44f421bb0950029a58602982a4cdba8822d0630aa2aaf90c6ff96e3911a78e5.png)

---

*Originally published on [N00b21337](https://paragraph.com/@n00b21337/how-to-prepare-parameters-for-executecall)*
