Submitted by shaflow2, also found by shaflow2 (1, 2), Abdessamed, Daniel_eth, and Emmanuel (1, 2)
https://github.com/code-423n4/2024-08-chakra/blob/d0d45ae1d26ca1b87034e67180fac07ce9642fd9/solidity/handler/contracts/ChakraSettlementHandler.sol#L127
https://github.com/code-423n4/2024-08-chakra/blob/d0d45ae1d26ca1b87034e67180fac07ce9642fd9/solidity/handler/contracts/ChakraSettlementHandler.sol#L338
https://github.com/code-423n4/2024-08-chakra/blob/d0d45ae1d26ca1b87034e67180fac07ce9642fd9/cairo/handler/src/handler_erc20.cairo#L127
LockMint and BurnUnlock modes refer to the following:
However, because the ChakraSettlementHandler protocol is responsible for both processing remote cross-chain messages and sending cross-chain messages to remote chains, a single mode setting cannot handle both tasks simultaneously. This results in one of the tasks functionalities being unavailable due to incorrect protocol implementation.
When the LockMint mode is used, it means that the source chain employs the LockUnlock mode. Therefore, during the receive cross-chain message, tokens should not be minted but rather unlocked.
Similarly, when the BurnUnlock mode is used, it means that the source chain employs the MintBurn mode. Thus, during the receive cross-chain message, tokens should not be unlocked but rather minted.
In the Cairo program, the same issue also exists.
The following is the correct logic:
In Cairo:
pidb (Chakra) confirmed
0xsomeone (judge) commented:
