Solidity - How can I start to understand the bytecode in order to call a function of a deployed smart contract?

Viewed 312

I can go through the opcodes for the parts of the bytecode, but I don't understand how to figure out how to call a deployed contract. Somewhat new to ethereum and solidiy, any help is appreciated. For example:

0x60806040526040518060400160405280600c81526020017f696e697469616c697365643100000000000000000000000000000000000000008152506000908051906020019061004f9291906100ae565b506040518...

1 Answers

You realy don't need to understand this. To call deployed contract you need to have either it's code or abi and address.

Then you create your contract and call it through that.

Like this

import "contractYouWantToInteractWith.sol";

contract Interact {
    contractYouWantToInteractWith public contract = contractYouWantToInteractWith(addressOfTheContract);

// Then just call on it like this

    function interact() public {
        contract.FUNCTIONFROMTHECONTRACT(inputs);
    }

}
Related