Submitted by ABAIKUNANBAEV, also found by AllTooWell, rbserver, said, Abdessamed, Draiakoo, and 0xNirix
receive_cross_chain_msg() is located in the Settlement contract and is called after the Chakra network signature verification process. However, when creating ReceivedCrossChainTx struct for the new receive_cross_txs[txid], the contract mistakenly uses address(this) instead of to_handler address.
Currently receive_cross_txs[txId] is assigned this way:
https://github.com/code-423n4/2024-08-chakra/blob/main/solidity/settlement/contracts/ChakraSettlement.sol#L205-214
However, address(this) should be replaced by to_handler:
https://github.com/code-423n4/2024-08-chakra/blob/main/solidity/settlement/contracts/ChakraSettlement.sol#L31-40
As you can see here, after from_handler, there is to_handler address but its mistakenly set as address(this) which is an address of the settlement contract in reality.
Therefore, receive_cross_txs[txid] has incorrect parameters when creating a new received transaction struct.
Change address(this) on to_handler address in a receive_cross_txs[txid] mapping.
pidb (Chakra) confirmed
0xsomeone (judge) commented:
