Skip to content
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: rename deployTokenManager to linkToken and change the message type for deploying remote token managers #318

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Foivos
Copy link
Contributor

@Foivos Foivos commented Jan 9, 2025

@Foivos Foivos requested a review from a team as a code owner January 9, 2025 11:45
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 8 lines in your changes missing coverage. Please review.

Project coverage is 98.11%. Comparing base (d38f107) to head (106c02d).

Files with missing lines Patch % Lines
contracts/InterchainTokenService.sol 70.37% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #318      +/-   ##
==========================================
- Coverage   99.18%   98.11%   -1.08%     
==========================================
  Files          20       20              
  Lines         738      743       +5     
  Branches      170      171       +1     
==========================================
- Hits          732      729       -3     
- Misses          6       14       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

contracts/InterchainTokenService.sol Outdated Show resolved Hide resolved
if (!success) revert GatewayCallFailed(returnData);
}

function linkToken(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a docstring

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention that for EVM destination, linkParams is just the token manager operator address as bytes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added docstring

contracts/InterchainTokenService.sol Outdated Show resolved Hide resolved
contracts/InterchainTokenService.sol Outdated Show resolved Hide resolved
// Custom token managers can't be deployed with native interchain token type, which is reserved for interchain tokens
if (tokenManagerType == TokenManagerType.NATIVE_INTERCHAIN_TOKEN) revert CannotDeploy(tokenManagerType);

address deployer = msg.sender;

if (deployer == interchainTokenFactory) {
if (msg.sender == interchainTokenFactory) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (msg.sender == interchainTokenFactory) {
if (deployer == interchainTokenFactory) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you changed that in the original PR and I was wondering why.

bytes32 tokenId,
string calldata destinationChain,
uint256 gasValue,
bytes memory destinationTokenAddress,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bytes memory destinationTokenAddress,
bytes calldata destinationTokenAddress,

TokenManagerType tokenManagerType,
bytes calldata params
bytes memory params,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bytes memory params,
bytes calldata params,

@@ -944,13 +968,17 @@ contract InterchainTokenService is
_callContract(destinationChain, payload, IGatewayCaller.MetadataVersion.CONTRACT_CALL, gasValue);
}

/**
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*
/**

removed accidentally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

* @param tokenManagerType The type of token manager. Cannot be NATIVE_INTERCHAIN_TOKEN.
* @param params The deployment parameters.
* @param linkParams The link parameters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention that note on operator being linkParams for EVM case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

test/InterchainTokenService.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants