diff --git a/typescript/infra/config/environments/mainnet3/warp/eclipse-SOL-deployments.yaml b/typescript/infra/config/environments/mainnet3/warp/eclipse-SOL-deployments.yaml new file mode 100644 index 000000000..0469f45eb --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/eclipse-SOL-deployments.yaml @@ -0,0 +1,23 @@ +# Configs and artifacts for the deployment of Hyperlane Warp Routes +# Between injective and inevm +description: Hyperlane Warp Route artifacts +timestamp: '2024-09-19T16:00:00.000Z' +deployer: Abacus Works (Hyperlane) +data: + config: + solanamainnet: + protocolType: sealevel + type: native + hypAddress: '8DtAGQpcMuD5sG3KdxDy49ydqXUggR1LQtebh2TECbAc' + name: Solana + symbol: SOL + decimals: 9 + eclipsemainnet: + protocolType: sealevel + type: synthetic + hypAddress: 'FJu4E1BDYKVg7aTWdwATZRUvytJZ8ZZ2gQuvPfMWAz9y' + tokenAddress: 'BeRUj3h7BqkbdfFU7FBNYbodgf8GCHodzKvF9aVjNNfL' + isSpl2022: true + name: Solana + symbol: SOL + decimals: 9 diff --git a/typescript/infra/config/environments/mainnet3/warp/eclipse-USDC-deployments.yaml b/typescript/infra/config/environments/mainnet3/warp/eclipse-USDC-deployments.yaml new file mode 100644 index 000000000..2955d2c84 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/eclipse-USDC-deployments.yaml @@ -0,0 +1,33 @@ +# Configs and artifacts for the deployment of Hyperlane Warp Routes +# Between injective and inevm +description: Hyperlane Warp Route artifacts +timestamp: '2024-09-19T16:00:00.000Z' +deployer: Abacus Works (Hyperlane) +data: + config: + ethereum: + protocolType: ethereum + type: collateral + hypAddress: '0xe1De9910fe71cC216490AC7FCF019e13a34481D7' + tokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' # USDC + name: USDC + symbol: USDC + decimals: 6 + solanamainnet: + protocolType: sealevel + type: collateral + hypAddress: '3EpVCPUgyjq2MfGeCttyey6bs5zya5wjYZ2BE6yDg6bm' + tokenAddress: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' + isSpl2022: false + name: USDC + symbol: USDC + decimals: 6 + eclipsemainnet: + protocolType: sealevel + type: synthetic + hypAddress: 'EqRSt9aUDMKYKhzd1DGMderr3KNp29VZH3x5P7LFTC8m' + tokenAddress: 'AKEWE7Bgh87GPp171b4cJPSSZfmZwQ3KaqYqXoKLNAEE' + isSpl2022: true + name: USDC + symbol: USDC + decimals: 6 diff --git a/typescript/infra/config/environments/mainnet3/warp/eclipse-WIF-deployments.yaml b/typescript/infra/config/environments/mainnet3/warp/eclipse-WIF-deployments.yaml new file mode 100644 index 000000000..94e44a8b1 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/eclipse-WIF-deployments.yaml @@ -0,0 +1,24 @@ +# Configs and artifacts for the deployment of Hyperlane Warp Routes +# Between injective and inevm +description: Hyperlane Warp Route artifacts +timestamp: '2024-09-19T16:00:00.000Z' +deployer: Abacus Works (Hyperlane) +data: + config: + solanamainnet: + protocolType: sealevel + type: collateral + hypAddress: 'CuQmsT4eSF4dYiiGUGYYQxJ7c58pUAD5ADE3BbFGzQKx' + tokenAddress: 'EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm' + name: dogwifhat + symbol: WIF + decimals: 9 + eclipsemainnet: + protocolType: sealevel + type: synthetic + hypAddress: '6tBGmKNxirxBYnm9khkaTtcr2fhJ9YviCgRm1RWM8NJv' + tokenAddress: '841P4tebEgNux2jaWSjCoi9LhrVr9eHGjLc758Va3RPH' + isSpl2022: false + name: dogwifhat + symbol: WIF + decimals: 9 diff --git a/typescript/infra/config/environments/mainnet3/warp/eclipse-tETH-deployments.yaml b/typescript/infra/config/environments/mainnet3/warp/eclipse-tETH-deployments.yaml new file mode 100644 index 000000000..1f77a34e5 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/eclipse-tETH-deployments.yaml @@ -0,0 +1,24 @@ +# Configs and artifacts for the deployment of Hyperlane Warp Routes +# Between injective and inevm +description: Hyperlane Warp Route artifacts +timestamp: '2024-09-19T16:00:00.000Z' +deployer: Abacus Works (Hyperlane) +data: + config: + ethereum: + protocolType: ethereum + type: collateral + hypAddress: '0xc2495f3183F043627CAECD56dAaa726e3B2D9c09' + tokenAddress: '0x19e099B7aEd41FA52718D780dDA74678113C0b32' + name: Turbo Eth + symbol: tETH + decimals: 18 + eclipsemainnet: + protocolType: sealevel + type: synthetic + hypAddress: '6GM7hy6M6LjhadG1xuKXPQ3jPC1eieEszR8DforoRzUp' + tokenAddress: 'GU7NS9xCwgNPiAdJ69iusFrRfawjDDPjeMBovhV1d4kn' + isSpl2022: false + name: Turbo Eth + symbol: tETH + decimals: 9 diff --git a/typescript/infra/scripts/warp-routes/monitor-warp-routes-balances.ts b/typescript/infra/scripts/warp-routes/monitor-warp-routes-balances.ts index e06031096..160a777f5 100644 --- a/typescript/infra/scripts/warp-routes/monitor-warp-routes-balances.ts +++ b/typescript/infra/scripts/warp-routes/monitor-warp-routes-balances.ts @@ -17,6 +17,8 @@ import { CwNativeTokenAdapter, MultiProtocolProvider, SealevelHypCollateralAdapter, + SealevelHypNativeAdapter, + SealevelHypSyntheticAdapter, TokenType, WarpRouteConfig, WarpRouteConfigSchema, @@ -135,8 +137,24 @@ async function checkBalance( ); } case ProtocolType.Sealevel: - // TODO - solana native - return 0; + const adapter = new SealevelHypNativeAdapter( + chain, + multiProtocolProvider, + { + token: token.tokenAddress, + warpRouter: token.hypAddress, + // Mailbox only required for transfers, using system as placeholder + mailbox: SystemProgram.programId.toBase58(), + }, + // Not used for native tokens, but required for the adapter + token?.isSpl2022 ?? false, + ); + const balance = ethers.BigNumber.from( + await adapter.getBalance(token.hypAddress), + ); + return parseFloat( + ethers.utils.formatUnits(balance, token.decimals), + ); case ProtocolType.Cosmos: { if (!token.ibcDenom) throw new Error('IBC denom missing for native token'); @@ -174,7 +192,7 @@ async function checkBalance( } case ProtocolType.Sealevel: { if (!token.tokenAddress) - throw new Error('Token address missing for synthetic token'); + throw new Error('Token address missing for collateral token'); const adapter = new SealevelHypCollateralAdapter( chain, multiProtocolProvider, @@ -228,10 +246,27 @@ async function checkBalance( ); } case ProtocolType.Sealevel: - // TODO - solana native - return 0; + if (!token.tokenAddress) + throw new Error('Token address missing for synthetic token'); + const adapter = new SealevelHypSyntheticAdapter( + chain, + multiProtocolProvider, + { + token: token.tokenAddress, + warpRouter: token.hypAddress, + // Mailbox only required for transfers, using system as placeholder + mailbox: SystemProgram.programId.toBase58(), + }, + token?.isSpl2022 ?? false, + ); + const syntheticBalance = ethers.BigNumber.from( + await adapter.getTotalSupply(), + ); + return parseFloat( + ethers.utils.formatUnits(syntheticBalance, token.decimals), + ); case ProtocolType.Cosmos: - // TODO - cosmos native + // TODO - cosmos synthetic return 0; } break; diff --git a/typescript/infra/src/warp/helm.ts b/typescript/infra/src/warp/helm.ts index f1207f9a6..4633ddd83 100644 --- a/typescript/infra/src/warp/helm.ts +++ b/typescript/infra/src/warp/helm.ts @@ -27,7 +27,7 @@ export class WarpRouteMonitorHelmManager extends HelmManager { return { image: { repository: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: 'fce6adf-20240905-094435', + tag: 'd4d5501-20240925-222735', }, configFilePath: pathRelativeToMonorepoRoot, fullnameOverride: this.helmReleaseName, diff --git a/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts b/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts index 0d5b99e13..8287fa07b 100644 --- a/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts +++ b/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts @@ -119,7 +119,7 @@ export class SealevelTokenAdapter extends BaseSealevelAdapter implements ITokenAdapter { - public readonly tokenProgramPubKey: PublicKey; + public readonly tokenMintPubKey: PublicKey; constructor( public readonly chainName: ChainName, @@ -128,7 +128,7 @@ export class SealevelTokenAdapter public readonly isSpl2022: boolean = false, ) { super(chainName, multiProvider, addresses); - this.tokenProgramPubKey = new PublicKey(addresses.token); + this.tokenMintPubKey = new PublicKey(addresses.token); } async getBalance(owner: Address): Promise { @@ -183,7 +183,7 @@ export class SealevelTokenAdapter deriveAssociatedTokenAccount(owner: PublicKey): PublicKey { return getAssociatedTokenAddressSync( - this.tokenProgramPubKey, + this.tokenMintPubKey, owner, true, this.getTokenProgramId(), @@ -639,7 +639,7 @@ export class SealevelHypCollateralAdapter extends SealevelHypTokenAdapter { /// 9. [executable] The SPL token program for the mint. { pubkey: this.getTokenProgramId(), isSigner: false, isWritable: false }, /// 10. [writeable] The mint. - { pubkey: this.tokenProgramPubKey, isSigner: false, isWritable: true }, + { pubkey: this.tokenMintPubKey, isSigner: false, isWritable: true }, /// 11. [writeable] The token sender's associated token account, from which tokens will be sent. { pubkey: this.deriveAssociatedTokenAccount(params.sender), @@ -696,6 +696,13 @@ export class SealevelHypSyntheticAdapter extends SealevelHypTokenAdapter { } } + async getTotalSupply(): Promise { + const response = await this.getProvider().getTokenSupply( + this.tokenMintPubKey, + ); + return BigInt(response.value.amount); + } + deriveMintAuthorityAccount(): PublicKey { return super.derivePda( ['hyperlane_token', '-', 'mint'],