'Solidity - How can I start to understand the bytecode in order to call a function of a deployed smart contract?
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...
Solution 1:[1]
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);
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dharman |
