Skip to content

Commit 03344c4

Browse files
martin0995eshabenilariaeIlaria Enachedawnkelly09
authored
Martinh/whscan demo new ia (#307)
* move pages, links, images, and snippets to new IA * Ilariae/settlement ia (#268) * add settlement to learn section * add settlement to buil section * fix links * liquidity layer code snippets * solver snippets * llms --------- Co-authored-by: Ilaria Enache <ilaria@Host-009.homenet.telecomitalia.it> * Dawn/connect index makeover (#263) * adds connect index page to new IA * tweaks admonition usage on /docs/build/transfers/connect/overview/ * moves timeline into snippet, left aligned * feedback per review * llms * edits per feedback * improve intro * edits per feedback * applies review feedback * Apply suggestions from code review Co-authored-by: Erin Shaben <eshaben@icloud.com> --------- Co-authored-by: Erin Shaben <eshaben@icloud.com> * Bring token bridge build into new ia (#279) * adds token bridge build page in the new ai and fixes links * Update build/transfers/token-bridge.md Co-authored-by: Lucas Malizia <131050418+0xlukem@users.noreply.github.com> * Update build/transfers/token-bridge.md Co-authored-by: Lucas Malizia <131050418+0xlukem@users.noreply.github.com> --------- Co-authored-by: Ilaria Enache <ilaria@Host-009.homenet.telecomitalia.it> Co-authored-by: Lucas Malizia <131050418+0xlukem@users.noreply.github.com> * Ilariae/settlement faq (#278) * settlement faq * typo fix * Update build/transfers/settlement/faqs.md Co-authored-by: Lucas Malizia <131050418+0xlukem@users.noreply.github.com> * Update build/transfers/settlement/faqs.md Co-authored-by: Lucas Malizia <131050418+0xlukem@users.noreply.github.com> * quick fix * fix * Update build/transfers/settlement/.pages Co-authored-by: Erin Shaben <eshaben@icloud.com> * typo fix * Update build/transfers/settlement/.pages Co-authored-by: Lucas Malizia <131050418+0xlukem@users.noreply.github.com> * apply feedback and llms --------- Co-authored-by: Ilaria Enache <ilaria@Host-009.homenet.telecomitalia.it> Co-authored-by: Lucas Malizia <131050418+0xlukem@users.noreply.github.com> Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it> Co-authored-by: Erin Shaben <eshaben@icloud.com> * adds content: build/core messaging/index (#281) * adds build/core-messaging/index page * grammarly and llms * Apply suggestions from code review Co-authored-by: Erin Shaben <eshaben@icloud.com> * change cross-chain to multichain, update llms * combine timelines into one * corrects timeline syntax, updates llms --------- Co-authored-by: Erin Shaben <eshaben@icloud.com> * merge the latest from main into new-product-ia (#295) Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it> * Add build/transfers/index page (#275) * adds connect index page to new IA * tweaks admonition usage on /docs/build/transfers/connect/overview/ * moves timeline into snippet, left aligned * feedback per review * llms * edits per feedback * improve intro * edits per feedback * adds build/transfers/index page * llms * updates per review feedback * llms * change cross-chain to multichain, update llms * updates llms * Apply suggestions from code review Co-authored-by: Erin Shaben <eshaben@icloud.com> * adds back supported feature card per feedback, updates llms * Update build/transfers/index.md Co-authored-by: Erin Shaben <eshaben@icloud.com> * Update build/transfers/index.md Co-authored-by: Erin Shaben <eshaben@icloud.com> * Update build/transfers/index.md Co-authored-by: Erin Shaben <eshaben@icloud.com> --------- Co-authored-by: Erin Shaben <eshaben@icloud.com> Co-authored-by: Ilaria <43253244+ilariae@users.noreply.github.com> Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it> * Updates learn infra index page (#282) * adds connect index page to new IA * tweaks admonition usage on /docs/build/transfers/connect/overview/ * moves timeline into snippet, left aligned * feedback per review * llms * edits per feedback * improve intro * edits per feedback * applies review feedback * updates learn/infra index page * moves spy to timeline, removes additional resources * removes spy from timeline, adds next steps section * small edit, llms * Update learn/infrastructure/index.md Co-authored-by: Erin Shaben <eshaben@icloud.com> * Update .snippets/text/learn/infrastructure/infrastructure-index-timeline.json Co-authored-by: Erin Shaben <eshaben@icloud.com> --------- Co-authored-by: Ilaria <43253244+ilariae@users.noreply.github.com> Co-authored-by: Erin Shaben <eshaben@icloud.com> Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it> * updates learn transfers index (#283) * adds connect index page to new IA * tweaks admonition usage on /docs/build/transfers/connect/overview/ * moves timeline into snippet, left aligned * feedback per review * llms * edits per feedback * improve intro * edits per feedback * applies review feedback * updates learn/infra index page * updates learn/transfers/index page * Delete .snippets/text/build/transfers/connect/connect-timeline.json not needed in this PR * Delete build/transfers/connect/index.md * add placeholder connect index page * updates links on cards * moves spy to timeline, removes additional resources * removes spy from timeline, adds next steps section * change cross-chain to multichain, update llms * removes use case based copy, adds comparison NTT & TB, has TODOs * settlement section and ntt vs token bridge * applies updates from review feedback, updates llms * removes settlement table, displays NTTvsTB table, adds YT video embed, updates llms * Delete learn/infrastructure/index.md * small edit, llms * Update learn/infrastructure/index.md Co-authored-by: Erin Shaben <eshaben@icloud.com> * Update .snippets/text/learn/infrastructure/infrastructure-index-timeline.json Co-authored-by: Erin Shaben <eshaben@icloud.com> * Update learn/transfers/index.md Co-authored-by: Erin Shaben <eshaben@icloud.com> * Update learn/transfers/index.md Co-authored-by: Erin Shaben <eshaben@icloud.com> * Update learn/transfers/index.md Co-authored-by: Erin Shaben <eshaben@icloud.com> --------- Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it> Co-authored-by: Ilaria <43253244+ilariae@users.noreply.github.com> Co-authored-by: Erin Shaben <eshaben@icloud.com> * new content: build index page (#289) * adds new content for build/index page * moves timeline to snippets * converts timeline to cards per feedback * adds sections for multigov & queries, updates cross-chain to multichain, updates llms * updates from review feedback, updates llms * Update build/index.md Co-authored-by: Erin Shaben <eshaben@icloud.com> * Update build/index.md --------- Co-authored-by: Ilaria <43253244+ilariae@users.noreply.github.com> Co-authored-by: Erin Shaben <eshaben@icloud.com> Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it> * Dawn/learn index (#290) * adds connect index page to new IA * tweaks admonition usage on /docs/build/transfers/connect/overview/ * moves timeline into snippet, left aligned * feedback per review * llms * edits per feedback * improve intro * edits per feedback * applies review feedback * starts learn index page * removes placeholder * updates * learn/index page updates * adds settlement section, replaces cross-chain with multichain, updates LLMs * applies review feedback, updates llms * Update learn/index.md --------- Co-authored-by: Ilaria <43253244+ilariae@users.noreply.github.com> Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it> * Martinh/new product ia (#303) * Split contract integration faqs to new pages (#300) * split out FAQs from contract integrations section * add links * llm check --------- Co-authored-by: martin0995 <martin@papermoon.io> * update consistency level references (#299) * update consistency level references * fix link * fix link * remove duplicate text * updates for consistency * llm check --------- Co-authored-by: Martin Hofmann <martin@papermoon.io> * update link * llm check --------- Co-authored-by: Erin Shaben <eshaben@icloud.com> * tutorial migration to new ia * update link * llm check * typo fix (#308) Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it> * temporarily lower needed solana cli version for NTT (#306) Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it> * Martinh/update sdk v1.13.3 new ia (#309) * update tables with new sdk version * llm check * merge conflicts (#311) * Apply suggestions from code review Co-authored-by: Erin Shaben <eshaben@icloud.com> * llm check * update based on feedback * update function description * remove log * update code snippet * add code snippet * paragraph breaks * update function steps * add steps to subsection * llm check * update to function description * llm check * add complete function * llm check * Apply suggestions from code review Co-authored-by: Erin Shaben <eshaben@icloud.com> * llm check * Update tutorials/by-product/wormholescan/replace-signatures.md Co-authored-by: Erin Shaben <eshaben@icloud.com> * llm check --------- Co-authored-by: Erin Shaben <eshaben@icloud.com> Co-authored-by: Ilaria <43253244+ilariae@users.noreply.github.com> Co-authored-by: Ilaria Enache <ilaria@Host-009.homenet.telecomitalia.it> Co-authored-by: Dawn Kelly <83190195+dawnkelly09@users.noreply.github.com> Co-authored-by: Lucas Malizia <131050418+0xlukem@users.noreply.github.com> Co-authored-by: Ilaria Enache <ilaria@Host-006.homenet.telecomitalia.it>
1 parent e960a4a commit 03344c4

23 files changed

+2229
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2016",
4+
"module": "commonjs",
5+
"esModuleInterop": true,
6+
"forceConsistentCasingInFileNames": true,
7+
"strict": true,
8+
"skipLibCheck": true
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div id="termynal" data-termynal>
2+
<span data-ty="input"><span class="file-path"></span>npx tsx test/checkVaaValidity.run.ts</span>
3+
<span data-ty> </span>
4+
<span data-ty>✅ VAA Valid: true</span>
5+
<span data-ty="input"><span class="file-path"></span></span>
6+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div id="termynal" data-termynal>
2+
<span data-ty="input"><span class="file-path"></span>npx tsx test/checkVaaValidity.run.ts</span>
3+
<span data-ty> </span>
4+
<span data-ty>❌ VAA Valid: false, Reason: VM signature invalid</span>
5+
<span data-ty
6+
>Transaction: 0x3ad91ec530187bb2ce3b394d587878cd1e9e037a97e51fbc34af89b2e0719367</span
7+
>
8+
<span data-ty="input"><span class="file-path"></span></span>
9+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { fetchVaaId, fetchObservations } from '../src/helpers/vaaHelper';
2+
import { TXS } from '../src/config/constants';
3+
4+
const testFetchObservations = async () => {
5+
for (const tx of TXS) {
6+
const vaaIds = await fetchVaaId([tx]);
7+
8+
if (vaaIds.length === 0) {
9+
console.log(`No VAA ID found for transaction: ${tx}`);
10+
continue;
11+
}
12+
13+
for (const vaaId of vaaIds) {
14+
const observations = await fetchObservations(vaaId);
15+
16+
if (observations.length === 0) {
17+
console.log(`No observations found for VAA ID: ${vaaId}`);
18+
continue;
19+
}
20+
21+
console.log(
22+
`Transaction: ${tx}\nVAA ID: ${vaaId}\nObservations:`,
23+
observations
24+
);
25+
}
26+
}
27+
};
28+
29+
testFetchObservations();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<div id="termynal" data-termynal>
2+
<span data-ty="input"><span class="file-path"></span>npx tsx test/fetchObservations.run.ts</span>
3+
<span data-ty> </span>
4+
<span data-ty>Fetching observations</span>
5+
<span data-ty
6+
>Transaction: 0x3ad91ec530187bb2ce3b394d587878cd1e9e037a97e51fbc34af89b2e0719367</span
7+
>
8+
<span data-ty
9+
>Observations: [ { guardianAddr: '0xda798f6896a3331f64b48c12d1d57fd9cbe70811', signature:
10+
'ZGFlMDYyOGNjZjFjMmE0ZTk5YzE2OThhZjAzMDM4NzZlYTM1OWMxMzczNDA3YzdlMDMxZTkyNzk0ODkwYjRiYjRiOWFmNzM3NjRiMzIyOTE0ZTQwYzNlMjllMWEzNmM2NTc3ZDc5ZTdhNTM2MzA5YjA4YjExZjE3YzE3MDViNWIwMQ=='
11+
}, { guardianAddr: '0x74a3bf913953d695260d88bc1aa25a4eee363ef0', signature:
12+
'MzAyOTU4OGU4MWU0ODc0OTAwNDU3N2EzMGZlM2UxMDJjOWYwMjM0NWVhY2VmZWQ0ZGJlNTFkNmI3YzRhZmQ5ZTNiODFjNTg3MDNmYzUzNmJiYWFiZjNlODc1YTY3OTQwMGE4MmE3ZjZhNGYzOGY3YmRmNDNhM2VhNGQyNWNlNGMwMA=='
13+
},</span
14+
>
15+
<span data-ty>...]</span>
16+
<span data-ty="input"><span class="file-path"></span></span>
17+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { fetchGuardianSet } from '../src/helpers/vaaHelper';
2+
3+
const testFetchGuardianSet = async () => {
4+
const [guardians, guardianSetIndex] = await fetchGuardianSet();
5+
6+
console.log('Current Guardian Set Index:', guardianSetIndex);
7+
console.log('Guardian Addresses:', guardians);
8+
};
9+
10+
testFetchGuardianSet();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div id="termynal" data-termynal>
2+
<span data-ty="input"><span class="file-path"></span>npx tsx test/fetchGuardianSet.run.ts</span>
3+
<span data-ty> </span>
4+
<span data-ty>Fetching current guardian set</span>
5+
<span data-ty>Current Guardian Set Index: 4</span>
6+
<span data-ty>Guardian Addresses: [
7+
'0x5893b5a76c3f739645648885bdccc06cd70a3cd3',
8+
'0xff6cb952589bde862c25ef4392132fb9d4a42157',
9+
'0x114de8460193bdf3a2fcf81f86a09765f4762fd1',
10+
'0x107a0086b32d7a0977926a205131d8731d39cbeb',
11+
</span>
12+
<span data-ty>...]</span>
13+
<span data-ty="input"><span class="file-path"></span></span>
14+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import {
2+
fetchVaaId,
3+
fetchVaa,
4+
checkVaaValidity,
5+
fetchObservations,
6+
fetchGuardianSet,
7+
replaceSignatures,
8+
} from '../helpers/vaaHelper';
9+
import { TXS } from '../config/constants';
10+
11+
async function main() {
12+
try {
13+
for (const tx of TXS) {
14+
console.log(`\nProcessing TX: ${tx}\n`);
15+
16+
// 1. Fetch Transaction VAA IDs:
17+
const vaaIds = await fetchVaaId([tx]);
18+
if (!vaaIds.length) continue;
19+
20+
// 2. Fetch VAA Data:
21+
const vaaData = await fetchVaa(vaaIds);
22+
if (!vaaData.length) continue;
23+
24+
const vaaBytes = vaaData[0].vaaBytes;
25+
if (!vaaBytes) continue;
26+
27+
// 3. Check VAA Validity:
28+
const { valid } = await checkVaaValidity(vaaBytes);
29+
if (valid) continue;
30+
31+
// 4. Fetch Observations (VAA signatures):
32+
const observations = await fetchObservations(vaaIds[0]);
33+
34+
// 5. Fetch Current Guardian Set:
35+
const [currentGuardians, guardianSetIndex] = await fetchGuardianSet();
36+
37+
// 6. Replace Signatures:
38+
const response = await replaceSignatures(
39+
Buffer.from(vaaBytes, 'base64'),
40+
observations,
41+
currentGuardians,
42+
guardianSetIndex
43+
);
44+
45+
if (!response) continue;
46+
}
47+
} catch (error) {
48+
console.error('❌ Error in execution:', error);
49+
process.exit(1);
50+
}
51+
}
52+
53+
main();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div id="termynal" data-termynal>
2+
<span data-ty="input"><span class="file-path"></span>npx tsx src/scripts/replaceSignatures.ts</span>
3+
<span data-ty> </span>
4+
<span data-ty>Processing TX: 0x3ad91ec530187bb2ce3b394d587878cd1e9e037a97e51fbc34af89b2e0719367</span>
5+
<span data-ty>❌ VAA Valid: false, Reason: VM signature invalid</span>
6+
<span data-ty>Fetching observations</span>
7+
<span data-ty>Fetching current guardian set</span>
8+
<span data-ty>Replacing Signatures...</span>
9+
<span data-ty>Outdated Guardian Indexes: [ 0 ]</span>
10+
<span data-ty>Sending updated VAA to RPC...</span>
11+
<span data-ty>Updated VAA (hex): 0x01000000040d010019447b72d51e33923a3d6b28496ccd3722d5f1e33e2...</span>
12+
<span data-ty="input"><span class="file-path"></span></span>
13+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const RPC = 'https://ethereum-rpc.publicnode.com';
2+
3+
export const ETH_CORE =
4+
'0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B'.toLowerCase();
5+
6+
export const WORMHOLESCAN_API = 'https://api.wormholescan.io/v1';
7+
8+
export const LOG_MESSAGE_PUBLISHED_TOPIC =
9+
'0x6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b2';
10+
11+
export const TXS = [
12+
'0x3ad91ec530187bb2ce3b394d587878cd1e9e037a97e51fbc34af89b2e0719367',
13+
'0x3c989a6bb40dcd4719453fbe7bbac420f23962c900ae75793124fc9cc614368c',
14+
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
export const PARSE_AND_VERIFY_VM_ABI = {
2+
inputs: [{ internalType: 'bytes', name: 'encodedVM', type: 'bytes' }],
3+
name: 'parseAndVerifyVM',
4+
outputs: [
5+
{
6+
components: [
7+
{ internalType: 'uint8', name: 'version', type: 'uint8' },
8+
{ internalType: 'uint32', name: 'timestamp', type: 'uint32' },
9+
{ internalType: 'uint32', name: 'nonce', type: 'uint32' },
10+
{ internalType: 'uint16', name: 'emitterChainId', type: 'uint16' },
11+
{ internalType: 'bytes32', name: 'emitterAddress', type: 'bytes32' },
12+
{ internalType: 'uint64', name: 'sequence', type: 'uint64' },
13+
{ internalType: 'uint8', name: 'consistencyLevel', type: 'uint8' },
14+
{ internalType: 'bytes', name: 'payload', type: 'bytes' },
15+
{ internalType: 'uint32', name: 'guardianSetIndex', type: 'uint32' },
16+
{
17+
components: [
18+
{ internalType: 'bytes32', name: 'r', type: 'bytes32' },
19+
{ internalType: 'bytes32', name: 's', type: 'bytes32' },
20+
{ internalType: 'uint8', name: 'v', type: 'uint8' },
21+
{ internalType: 'uint8', name: 'guardianIndex', type: 'uint8' },
22+
],
23+
internalType: 'struct Structs.Signature[]',
24+
name: 'signatures',
25+
type: 'tuple[]',
26+
},
27+
{ internalType: 'bytes32', name: 'hash', type: 'bytes32' },
28+
],
29+
internalType: 'struct Structs.VM',
30+
name: 'vm',
31+
type: 'tuple',
32+
},
33+
{ internalType: 'bool', name: 'valid', type: 'bool' },
34+
{ internalType: 'string', name: 'reason', type: 'string' },
35+
],
36+
stateMutability: 'view',
37+
type: 'function',
38+
};

0 commit comments

Comments
 (0)