Conversation
specs/interop/liquidity_migration.md
Outdated
| The function will | ||
|
|
||
| 1. Check that `_legacyAddr` and `_superAddr` are valid and paired. | ||
| 2. Check both tokens have the same amount of decimals. |
There was a problem hiding this comment.
I think this is probably the best option. Figuring out how to handle decimal changes is a big can of worms.
There was a problem hiding this comment.
Yes, that seems to be the consensus.
For context, L1 deposits do not check decimals at all, and it's perfectly the same to do the same here (remove the check altogether). In that case, the market should adjust the pricing for each representation.
So, both approaches are safe:
- enforce the same decimals
- don't enforce and let the market price the assets
I think it's mostly a UX decision.
specs/interop/liquidity_migration.md
Outdated
|
|
||
| 1. For representations minted before | ||
| the `OptimismMintableERC20Factory` upgrade: | ||
| Check an allowed token list that connects L2 representations with the |
There was a problem hiding this comment.
How will this list be populated?
There was a problem hiding this comment.
It would be relatively straightforward to do this trustlessly but would require that we have an external function that can be called to populate the mapping. I would prefer that over a trusted solution.
There was a problem hiding this comment.
@smartcontracts the idea was to do it in a trusted manner, here's a relevant comment from @tynes: ethereum-optimism/design-docs#46 (comment), proto had suggested a slightly different approach using an onion-hash, which is the R&D discord
There was a problem hiding this comment.
We can assume that the mapping will be populated correctly as part of this spec, we can work on a design doc for how to populate the mapping separately
specs/interop/liquidity_migration.md
Outdated
| to its `REMOTE_TOKEN` | ||
| (both allowed list and new deployments). | ||
|
|
||
| 2. Valid `SuperchainERC20` address: |
There was a problem hiding this comment.
Sanity check: do we assume that the remote token address is always an L1 address? Is there any case where the remote token address may not be an L1 address?
There was a problem hiding this comment.
For the scope of this spec, we can assume the remote token is an L1 address.
We had an internal discussion on whether to name it l1Address or something similar for this spec. Still, we went for the remote naming because we think a similar logic will eventually be used for L2 native tokens, where the remote address will not correspond to L1 but to the native L2.
|
@mds1 It would be really good to have your review on this if you have time |
…ultiple minor comments
specs/interop/liquidity_migration.md
Outdated
| #### Version | ||
|
|
||
| Ensure the `OptimismMintableERC20Factory` implementation uses CREATE2 instead of CREATE and decimals as part of the salt. | ||
| This is in line with the latest stable implementation in the |
There was a problem hiding this comment.
This comment is going to go stale, meaning that at some point it will no longer be the latest implementation
There was a problem hiding this comment.
I recommend just removing this paragraph and adding a paragraph that says that the mapping may also be filled with addresses computed from alternative mechanisms for some chains
specs/interop/liquidity_migration.md
Outdated
|
|
||
| #### Version | ||
|
|
||
| Ensure the `OptimismMintableERC20Factory` implementation uses CREATE2 instead of CREATE and decimals as part of the salt. |
There was a problem hiding this comment.
I think that we should add the spec for how the salt is computed. This is useful so that we can reason about invariants around how the deployments mapping is populated.
Right now it is:
bytes32 salt = keccak256(abi.encode(_remoteToken, _name, _symbol, _decimals));Since this isn't done with create3, a change in the solidity compiler version will result in different addresses. If it is easy to migrate to a create3 deployer, that would be preferred, but certainly not required. For the new factory we would definitely want to use create3
There was a problem hiding this comment.
I changed the paragraph to be as open as possible, only discouraging the use of CREATE, discussing the issue with CREATE2 and suggesting CREATE3 eventually.
Would you like us to work on a dedicated spec for the salt of the OptimismMintableERC20Factory then?
There was a problem hiding this comment.
What is the additional work in your mind besides what i linked above?
There was a problem hiding this comment.
Nevermind, lol. It would not be worth.
I modified the paragraph in the latest commit. Let me know what do you think of it.
tynes
left a comment
There was a problem hiding this comment.
This is amazing! Great work :D
Description
The Liquidity Migration Specs will cover the required modifications to allowed converting between legacy and
SuperchainERC20tokens using theL2StandardBridge.Additional context
This specs formalizes the Convert Unified Design Docs