cartesi / rollups-contracts

Smart Contracts for Cartesi Rollups
https://cartesi.github.io/rollups-contracts/
Apache License 2.0
18 stars 38 forks source link

Add `getInputRelays` function to `ICartesiDApp` #150

Closed guidanoli closed 9 months ago

guidanoli commented 9 months ago

📚 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 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

guidanoli commented 9 months ago

FYI @tuler