There are many token standards available based on the use case. There are even more token standards under development. POS Portal needs to support as many of these as possible so that it can be used by maximum dapps.
Current Implementation of POS Portal supports deposit and withdraw for ERC20 tokens. This needs to be extended to support ERC721 and ERC1155 tokens. Furthermore, the implementation should be able to support more token types in future with minimal logic changes.
The basic mechanism remains the same for all tokens. While depositing, tokens should be locked in the POS Portal on root chain and the corresponding tokens should be minted on matic chain. While withdrawing, tokens should be burned on matic chain and exited from POS Portal by submitting burn proof. Verification of burn proof involves verifying token burn, receipt inclusion and checkpoint inclusion. This process also remains the same. This common logic should be kept in a master contract.
Token specific predicate contracts should be created, sharing a common interface. These contracts will have methods to handle specific logic like token transfer, burn verification etc.
Token type should be identified using
bytes32 identifier. New tokens can be supported by simply registering a predicate against its identifier.