There should be an entry point where outsiders can know which contracts the DApp back-end is expecting inputs from. These contracts are called input relays. Most input relays also deal with assets, such as Ether and ERC-20 tokens.
✔️ Solution
Add a getSupportedInputRelays function to ICartesiDApp which returns an array of addresses from which the DApp back-end expects inputs from. Off-chain components such as the node CLI will be able to tell the type of input relay by calling the supportsInterface function on each input relay address. These addresses may even be typed as IERC165 from OpenZeppelin to help the node make these calls seamlessly without type casts.
function getInputRelays() external view returns (address[] memory);
The list of supported input relays will be decided on construction.
📈 Subtasks
[ ] Add an address[] parameter to the function and events of CartesiDAppFactory and ICartesiDApp
[ ] Add an address[] parameter to the CartesiDApp constructor
[ ] Adjust CartesiDAppFactory to instantiate CartesiDApp properly
[ ] Add a getInputRelays function to ICartesiDApp and CartesiDApp
📚 Context
There should be an entry point where outsiders can know which contracts the DApp back-end is expecting inputs from. These contracts are called input relays. Most input relays also deal with assets, such as Ether and ERC-20 tokens.
✔️ Solution
Add a
getSupportedInputRelays
function toICartesiDApp
which returns an array of addresses from which the DApp back-end expects inputs from. Off-chain components such as the node CLI will be able to tell the type of input relay by calling thesupportsInterface
function on each input relay address. These addresses may even be typed asIERC165
from OpenZeppelin to help the node make these calls seamlessly without type casts.The list of supported input relays will be decided on construction.
📈 Subtasks
address[]
parameter to the function and events ofCartesiDAppFactory
andICartesiDApp
address[]
parameter to theCartesiDApp
constructorCartesiDAppFactory
to instantiateCartesiDApp
properlygetInputRelays
function toICartesiDApp
andCartesiDApp