-
Notifications
You must be signed in to change notification settings - Fork 17
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: added automatic token migration #317
base: feat/manual-migrate-tokens
Are you sure you want to change the base?
Conversation
/// @dev Track the flow amount being received via the message | ||
ITokenManager(tokenManager).addFlowIn(amount); |
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.
/// @dev Track the flow amount being received via the message | |
ITokenManager(tokenManager).addFlowIn(amount); | |
_migrateToken(tokenManager, tokenAddress, tokenManagerType); | |
/// @dev Track the flow amount being received via the message | |
ITokenManager(tokenManager).addFlowIn(amount); |
call migrate separately so it's cleaner, gas cost difference should be very small
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.
you mean call it for every token type? indiscriminately? This would revert if the token in question does not implement isMinter
@@ -172,4 +178,10 @@ contract TokenHandler is ITokenHandler, ITokenManagerType, ReentrancyGuard, Crea | |||
function _burnTokenFrom(address tokenAddress, address from, uint256 amount) internal { | |||
IERC20(tokenAddress).safeCall(abi.encodeWithSelector(IERC20BurnableFrom.burnFrom.selector, from, amount)); | |||
} | |||
|
|||
function _migrateToken(address tokenManager, address tokenAddress) internal { |
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.
add a docstring to explain this auto migration feature
contracts/TokenHandler.sol
Outdated
tokenManagerType == uint256(TokenManagerType.NATIVE_INTERCHAIN_TOKEN) || tokenManagerType == uint256(TokenManagerType.MINT_BURN) | ||
) { | ||
if (tokenManagerType == uint256(TokenManagerType.NATIVE_INTERCHAIN_TOKEN)) { | ||
_migrateToken(tokenManager, tokenAddress); |
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.
same
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/manual-migrate-tokens #317 +/- ##
==============================================================
- Coverage 99.18% 99.06% -0.13%
==============================================================
Files 20 20
Lines 740 746 +6
Branches 175 174 -1
==============================================================
+ Hits 734 739 +5
- Misses 6 7 +1 ☔ View full report in Codecov by Sentry. |
AXE-7066