This is a base contract containing functions for calling with the co-processor and also a callback function to receive response from the co-processor. This function can be overridden where necessary or in the most simple implementation just the "handleCallback" function can be overridden to contain implementations to handle response from the co-processor.
- Install the base contract by running the following command:
forge install https://github.com/Mugen-Builders/coprocessor-base-contract
- Import the base contract into your project through the following command:
import "cartesi-coprocessor-base-contract/BaseContract.sol";
- Inherit the base contract and also populate the constructor parameters:
contract MyContract is CoprocessorAdapter {
constructor(address _coprocessorAddress, bytes32 _machineHash)
CoprocessorAdapter(_coprocessorAddress, _machineHash)
{}
// Add your Logic here
}
- Carsten Munk
- Henrique Marlon
- Idogwu Chinonso