Certain ERC20 contracts like RottonToken https://etherscan.io/address/0xd04785c4d8195e4a54d9dec3a9043872875ae9e2#code burns a portion of the original tokens for every transfer and also mints equivalent amount of burned tokens in the secondary tokens, which is then also sent to the recipient. For example: when a user locks 100,000 ROT tokens, 97500 ROT tokens gets transferred to the bridge manager (2.5% burned) and also 2500 MAGGOT tokens gets transferred to the bridge manager.
Currently, the bridge only mints the original tokens, i.e., 97500 1ROT to the user, however it should also automatically bridge 2500 1MAGGOT tokens to the user.
To accomplish this, the lockToken events call be processed. For example, https://etherscan.io/tx/0x88fb98c4991a149fbbfb800d7562c843b100785e0818fef52a7d672e8c562bea locks 100,000 ROT tokens, emitting two Transfer (index_topic_1 address from, index_topic_2 address to, uint256 value) events, recognizable through topic 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
For every such lockToken calls, the bridge backend should capture the secondary token transfer events and initiate bridging of those secondary tokens via another Multisig step.
Certain ERC20 contracts like RottonToken https://etherscan.io/address/0xd04785c4d8195e4a54d9dec3a9043872875ae9e2#code burns a portion of the original tokens for every transfer and also mints equivalent amount of burned tokens in the secondary tokens, which is then also sent to the recipient. For example: when a user locks 100,000 ROT tokens, 97500 ROT tokens gets transferred to the bridge manager (2.5% burned) and also 2500 MAGGOT tokens gets transferred to the bridge manager.
Currently, the bridge only mints the original tokens, i.e., 97500 1ROT to the user, however it should also automatically bridge 2500 1MAGGOT tokens to the user.
To accomplish this, the lockToken events call be processed. For example, https://etherscan.io/tx/0x88fb98c4991a149fbbfb800d7562c843b100785e0818fef52a7d672e8c562bea locks 100,000 ROT tokens, emitting two
Transfer (index_topic_1 address from, index_topic_2 address to, uint256 value)
events, recognizable through topic0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
.For every such lockToken calls, the bridge backend should capture the secondary token transfer events and initiate bridging of those secondary tokens via another Multisig step.