mosaicdao / mosaic-1

Mosaic-1 : meta-blockchains on Ethereum 1.x
8 stars 12 forks source link

Add inboxNonce and outboxNonce #307

Closed deepesh-kn closed 4 years ago

deepesh-kn commented 4 years ago

For deposit and withdraw flow, the nonce tracking for the sender is done in a single mapping mapping(address => uint256) public nonces;

If the sender do deposit and withdraw at the same time, then the nonces get messed up and only one of these transactions will succeed.

  1. Remove the nonce mapping from the ERC20GatewayBase.
  2. Add a separate mapping for the nonce in MessageInbox and MessageOutbox