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

Fix TBRv3 library issues #104

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

Fix TBRv3 library issues #104

wants to merge 34 commits into from

Conversation

Alex99y
Copy link
Collaborator

@Alex99y Alex99y commented Dec 27, 2024

  • Update all Wormhole SDK ts libs to the latest version (v1.3.0) and add all of them as a peerDependency to avoid the collision of multiple Wormhole SDK versions in one project.
  • Fix the layout for Solana devnet SC to deserialize a key that only exists in that network
  • Remove the mint address HTTP request and pass the data via function args.
  • Pass parameter value unwrapIntent for EVM
  • Fix amount parsing for Solana gasDropOff
  • Update @solana/web3.js dependency to the latest version (^1.98.0)
  • Upgrade yarn version from 4.4.1 to 4.6.0

@Alex99y Alex99y changed the title Fix TBRv3 Fix TBRv3 library issues Dec 30, 2024
Comment on lines 843 to 856
// FIXME: This should be in wormhole typescript sdk in the token bridge protocol for Solana:
// https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/a0daa3869620ddcddd87c073941de7d9ec65b38c/platforms/solana/protocols/tokenBridge/src/utils/tokenBridge/accounts/wrapped.ts#L60-L94
// Last updated sequence only exists in Testnet:
// https://github.com/wormhole-foundation/wormhole/blob/7bd40b595e22c5512dfaa2ed8e6d7441df743a69/solana/programs/token-bridge/src/legacy/state/wrapped_asset.rs#L32-L35
{ name: 'lastUpdatedSequence', binary: 'bytes', custom: {
to: (encoded: Uint8Array) => {
if (encoded.length === 0) return undefined;
if (encoded.length === 8) return deserializeLayout(uint64Layout, encoded);
throwError('Invalid lastUpdatedSequence length');
},
from: (decoded: bigint | undefined) =>
decoded === undefined ? new Uint8Array(0) : serializeLayout(uint64Layout, decoded),
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

With the rollback of the token bridge on testnet, this part has now become unnecessary... perfect timing... was there just long enough to hurt us.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, so this entire field can be removed, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed!

Comment on lines +839 to +842
const wrapMetaLayout = [
{ name: 'chain', ...layoutItems.chainItem(), endianness: 'little' },
{ name: 'address', ...layoutItems.universalAddressItem },
{ name: 'decimals', binary: 'uint', size: 1 },
Copy link
Contributor

Choose a reason for hiding this comment

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

This should should also be in the wormhole typescript SDK (@real-felix)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yet another item to add to the list

Comment on lines +77 to +78
const allowedTokenAddresses = this.config?.allowedTokenAddresses || [];
const isWhitelistConfigAvailable = this.config && allowedTokenAddresses.length > 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

What's all this about? This does not exactly fit the theme of the repo name of "arbitrary-token-transfers", no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nonergodic It is funny because I asked the same question. They want this restriction to prevent users from bridging useless tokens. By default is inactive and I believe that this feature will only be used in Portal Bridge UI.
@solanoepalacio can give you more default about this.

connect/platforms/solana/src/automatic.ts Outdated Show resolved Hide resolved
Comment on lines +839 to +842
const wrapMetaLayout = [
{ name: 'chain', ...layoutItems.chainItem(), endianness: 'little' },
{ name: 'address', ...layoutItems.universalAddressItem },
{ name: 'decimals', binary: 'uint', size: 1 },
Copy link
Contributor

Choose a reason for hiding this comment

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

Yet another item to add to the list

deployment/package.json 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.

4 participants