Skip to main content
3 of 4
added 120 characters in body

Interacting with closed source contract

I am an experienced developer but relatively new to blockchain development. There is a close source contract that I can interact with via the provider's web interface. The screenshot below is the receipt of one of the transactions.

If I can work out what the params are and inject my own data, how do I make a call to this contract from my own contract (in Solidity)?

Transaction Receipt


Update: As pointed out by Alex's answer, the screenshot above is the event emitted by the contract, not the function call metadata. The new screenshot below is of the transaction overview with Input Data.

Transaction made with Contract

I'm now trying to figure out how to make a call to this payable function using the suggested code below:

contract CallsFunctions {
    // for when you want to call any function on any contract
    function callAnything(address contractAddress, bytes memory args) payable external {
        (bool success, ) = contractAddress.call{ gas: 100000, value: msg.value }(args);
        require(success);
    }
}

In Remix, when I attempt to make a transaction, I get the following error:

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Internal JSON-RPC error. { "code": -32000, "message": "execution reverted" }

Making transaction from Remix


I have confirmed that the input data (args) is correct by attempting to make a transaction from the provider's web interface, then copy/paste the pre-signed data into Remix. I tried this on a test net with a custom callee contract and it worked fine.