0xPolygon / polygon-edge

A Framework for Building Ethereum-compatible Blockchain Networks
https://polygon.technology/solutions/polygon-edge/
Apache License 2.0
1.01k stars 533 forks source link

Deposit from L2 to L1 always fail for the firstime #1673

Closed rocky-balboa-1 closed 1 year ago

rocky-balboa-1 commented 1 year ago

Hello guys,

I am running 4 validators from your current source code (I tried running it from the released 1.0.0 code but it always shows an ERROR with quorum and proposalMessage not set, anyway this is not my issue here).

I bridged it to L1 polygon-mumbai testnet.

Everything is fine. However, I think there is a bug with your ChildMintableERC20Prediate.sol and ChildMintableERC721Predicate.sol.

That is, when I deposit a new token from L2 to L1 for the first time, there is only a mapping event on L1 and no new token was mint. When I do it the second time (which mean the token was already mapped), it success.

I tested for both ERC20 and ERC721, it was the same error.

So, hope that you can check this bug.

Thanks a lot.

rocky-balboa-1 commented 1 year ago

I have figured out that with new token mapping, there are 2 exit event Ids created at the same time. One for creating new contract and one for minting deposited token.