-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: smart M bridging #29
base: main
Are you sure you want to change the base?
Conversation
Changes to gas cost
🧾 Summary (20% most significant diffs)
Full diff report 👇
|
LCOV of commit
|
// Pre-compute the expected SpokeSmartMToken proxy address. | ||
address expectedSmartMTokenProxy_ = ContractHelper.getContractFrom(deployer_, _SPOKE_SMART_M_TOKEN_PROXY_NONCE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be best to deploy it before the SpokePortal.
Kind of tricky cause we need the SpokeVault and SpokePortal address but we can pre-compute these.
I think it's best to deploy the contracts that rely on nonces first and then we deploy the ones that rely on Create3.
|
||
/// @inheritdoc IPortal | ||
function setRemoteSmartMToken(uint16 remoteChainId_, bytes32 smartMToken_) external onlyOwner { | ||
remoteSmartMToken[remoteChainId_] = smartMToken_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should revert if trying to set it for the local network/chainId.
12cab5a
to
73d72bb
Compare
9176d84
to
d04ff4d
Compare
Proposed changes:
transferWrappedMToken
function to transfer a generic Wrapped M token by specifying source and destination Wrapped token addresses. Under the hood Wrapped M token is unwrapped to M token on the source, M token is bridged and wrapped back on the destination.transferWrappedMToken
function can be used to transfer M token extensions or convert from one wrapper on the source to another on the destination.transferSmartMToken
function to transfer Smart M token cross-chain. It's a simplified version oftransferWrappedMToken
function that doesn't take source and destination token addresses, as Smart M token address is set in the constructor.setRemoteSmartMToken
function to store Smart M Token address on the remote chains._receiveMToken
to handle M Token wrapping on the destination. If wrapping fails, M token is transferred to he the recipient.Challenges:
Due to the current Wormhole NTT design it's not possible to utilize NTTManager transfer for transferring Wrapped tokens and as a result some of the functionality is duplicated.
Next Steps and Questions:
transferWrappedMToken
andtransferSmartMToken
at this point.MTokenSent
andMTokenReceived
be modified?