Skip to content

fix(statics): fix unstETH support #6630

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

Merged
merged 1 commit into from
Aug 6, 2025
Merged

Conversation

saarujansathees578
Copy link
Contributor

TICKET: SC-2516

@saarujansathees578 saarujansathees578 force-pushed the SC-2516/fix-unsteth branch 7 times, most recently from ca7e025 to 55095a1 Compare August 5, 2025 22:49
@evanzbitgo evanzbitgo self-requested a review August 5, 2025 23:56
@evanzbitgo
Copy link
Contributor

Overall LGTM, just make sure it does not cause regressions

@saarujansathees578 saarujansathees578 force-pushed the SC-2516/fix-unsteth branch 2 times, most recently from 431839a to 80d7a2b Compare August 6, 2025 02:37
@saarujansathees578 saarujansathees578 marked this pull request as ready for review August 6, 2025 03:56
@saarujansathees578 saarujansathees578 requested review from a team as code owners August 6, 2025 03:56
Copilot

This comment was marked as outdated.

@saarujansathees578 saarujansathees578 requested a review from a team as a code owner August 6, 2025 13:01
zahin-mohammad
zahin-mohammad previously approved these changes Aug 6, 2025
Copy link
Contributor

@zahin-mohammad zahin-mohammad left a comment

Choose a reason for hiding this comment

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

Deferring to Evan's review here

@zahin-mohammad zahin-mohammad dismissed their stale review August 6, 2025 14:35

Will let eth/alt approve

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements support for ERC721 NFTs on the Ethereum network, extending the existing token infrastructure to handle non-fungible tokens alongside the current ERC20 token support.

  • Adds ERC721Token class with recovery functionality and NFT-specific operations
  • Extends token configuration structure to include NFT support for both mainnet and testnet
  • Updates coin factory registration to handle ERC721 token constructors

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
modules/statics/src/tokenConfig.ts Adds nfts property to token configurations and implements ERC721 token formatting
modules/sdk-coin-eth/src/index.ts Exports the new ERC721Token class
modules/sdk-coin-eth/src/erc721Token.ts Implements complete ERC721Token class with recovery and transaction functionality
modules/bitgo/test/v2/unit/ams/ams.ts Adds comprehensive test coverage for ERC721 NFT functionality
modules/bitgo/test/v2/resources/amsTokenConfig.ts Adds test configuration for ERC721 tokens
modules/bitgo/test/browser/browser.spec.ts Updates browser test expectations to include ERC721Token
modules/bitgo/src/v2/coins/index.ts Exports ERC721Token class
modules/bitgo/src/v2/coinFactory.ts Registers ERC721 token constructors and handles token type detection


if (isKrsRecovery) {
signedTx.backupKey = backupKey;
signedTx.coin = 'erc721';
Copy link
Preview

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

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

The hardcoded coin value 'erc721' should use the actual coin property from tokenConfig to match the expected format (e.g., 'eth', 'hteth'). This inconsistency could cause issues in recovery operations.

Suggested change
signedTx.coin = 'erc721';
signedTx.coin = this.tokenConfig.coin;

Copilot uses AI. Check for mistakes.

}

getFullName() {
return 'ERC721 Token';
Copy link
Preview

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

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

The hardcoded generic name 'ERC721 Token' should return the actual token name from tokenConfig.name to provide more meaningful identification, similar to how other token methods work.

Suggested change
return 'ERC721 Token';
return this.tokenConfig.name;

Copilot uses AI. Check for mistakes.

@@ -862,7 +869,11 @@ export function getTokenConstructor(tokenConfig: TokenConfig): CoinConstructor |
switch (tokenConfig.coin) {
case 'eth':
case 'hteth':
return Erc20Token.createTokenConstructor(tokenConfig as Erc20TokenConfig);
if (tokenConfig.type.includes('erc721')) {
Copy link
Preview

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

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

Using string inclusion check for token type detection is fragile. Consider using a more robust method like checking a specific token standard property or using startsWith('erc721:') to be more precise.

Suggested change
if (tokenConfig.type.includes('erc721')) {
if (tokenConfig.type.startsWith('erc721')) {

Copilot uses AI. Check for mistakes.

@saarujansathees578 saarujansathees578 merged commit 0de3c54 into master Aug 6, 2025
12 checks passed
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