Skip to content

Commit

Permalink
Merge branch 'master' into dawn/historical-updates-evm
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnkelly09 committed Jan 7, 2025
2 parents 3096935 + 6a7a49c commit ca6a7cb
Show file tree
Hide file tree
Showing 65 changed files with 1,001 additions and 112 deletions.
6 changes: 3 additions & 3 deletions .CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Thank you for your contributions, they are greatly appreciated 💜.

## Previewing Changes in VS Code

Unfortunately, there is not currrently a way to review the changes locally.
Unfortunately, there is not currently a way to review the changes locally.
However, if you're using Visual Studio Code, you can preview the changes you're making to `.md` files before committing them. To learn how, please check out the [Markdown and Visual Studio Code](https://code.visualstudio.com/docs/languages/markdown) guide from the Visual Studio docs site.

## Structure
Expand Down Expand Up @@ -37,7 +37,7 @@ Some important things to note:
- Files follow the convention of 'Display Name': 'file-name.md'
- Subdirectories are listed by their directory name in the source code

Both, **Canonical Contracts** and **Contract Addresses** are displayed in the left side navigation menu and on the landing page. The **Precompiled Contracts** title, comes from the `title` of the [`.pages` file for the `precompiles` subdirectory](https://github.com/moonbeam-foundation/moonbeam-docs/blob/master/builders/ethereum/canonical-contracts/precompiles/.pages).
Both, **Canonical Contracts** and **Contract Addresses** are displayed in the left side navigation menu and on the landing page. The **Precompiled Contracts** title, comes from the `title` of the [`.pages` file for the `precompiles` subdirectory](https://github.com/moonbeam-foundation/moonbeam-docs/blob/master/builders/ethereum/precompiles/.pages).

![Display titles](/images/readme-contributing/contributing-1.webp)

Expand Down Expand Up @@ -134,4 +134,4 @@ Here are some resources to help you create good titles and descriptions for SEO:
- [Google's recommendation on good titles](https://developers.google.com/search/docs/advanced/appearance/title-link?hl=en)
- [Google's recommendation on good descriptions](https://developers.google.com/search/docs/advanced/appearance/snippet?hl=en)

In general, titles should be between 50 and 60 characters and descriptions should be between 110 and 160 characters.
In general, titles should be between 50 and 60 characters and descriptions should be between 110 and 160 characters.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Request reviews from the formatting team for all PRs
* @moonbeam-foundation/devrel-formatting
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div id="termynal" data-termynal>
<span data-ty="input">yarn account:import</span>
<span data-ty>👛 Importing Wallet</span>
<span data-ty="input">Paste your private key: [hidden]</span>
<span data-ty="input">Enter a password to encrypt your private key: [hidden]</span>
<span data-ty="input">Confirm password: [hidden]</span>
<span data-ty>📄 Encrypted Private Key saved to packages/hardhat/.env file</span>
<span data-ty>🪄 Imported wallet address: 0x3B939FeaD1557C741Ff06492FD0127bd287A421e</span>
<span data-ty>⚠️ Make sure to remember your password! You'll need it to decrypt the private key.</span>
<span data-ty="input"> </span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div id="termynal" data-termynal>
<span data-ty="input">yarn compile</span>
<span data-ty>Generating typings for: 2 artifacts in dir: typechain-types for target: ethers-v6</span>
<span data-ty>Successfully generated 6 typings!</span>
<span data-ty>Compiled 2 Solidity files successfully (evm target: paris).</span>
<span data-ty="input"> </span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div id="termynal" data-termynal>
<span data-ty="input">yarn deploy</span>
<span data-ty="input">Enter password to decrypt private key: [hidden]</span>
<span data-ty>Nothing to compile</span>
<span data-ty>No need to generate any newer typings.</span>
<span data-ty>deploying "YourContract" (tx: 0xda4b71904cae30fad60669b321e1dd51b28a6cf197fc7ea13b5d85035b41d92c)...: deployed at 0xB527D4Ed38249d35cfCBAb92b51f45895622c6Eb with 837042 gas</span>
<span data-ty>👋 Initial greeting: Building Unstoppable Apps!!!</span>
<span data-ty>📝 Updated TypeScript contract definition file on ../nextjs/contracts/deployedContracts.ts</span>
<span data-ty="input"> </span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div id="termynal" data-termynal>
<span data-ty="input">yarn start</span>
<span data-ty> ▲ Next.js 14.2.11</span>
<span data-ty> - Local: http://localhost:3000</span>
<span data-ty> ✓ Starting...</span>
<span data-ty> Downloading swc package @next/swc-darwin-arm64...</span>
<span data-ty> ✓ Ready in 3.7s</span>
<span data-ty> ○ Compiling / ...</span>
<span data-ty>🌼 daisyUI 4.12.10</span>
<span data-ty>├─ ✔︎ 2 themes added https://daisyui.com/docs/themes</span>
<span data-ty>╰─ ★ Star daisyUI on GitHub https://github.com/saadeghi/daisyui</span>
<span data-ty> ✓ Compiled / in 10.8s (7727 modules)</span>
<span data-ty> GET / 200 in 11353ms</span>
<span data-ty> HEAD / 200 in 31ms</span>
<span data-ty="input"> </span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div id="termynal" data-termynal>
<span data-ty="input">yarn verify --api-url https://api-moonbase.moonscan.io</span>
<span data-ty>verifying YourContract (0xB527D4Ed38249d35cfCBAb92b51f45895622c6Eb) ...</span>
<span data-ty>waiting for result...</span>
<span data-ty>=> contract YourContract is now verified</span>
<span data-ty="input"> </span>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="termynal" data-termynal>
<span data-ty="input"><span class="file-path"></span>docker run --network host \
<br>-u $(id -u ${USER}):$(id -g ${USER}) \
moonbeamfoundation/moonbeam-tracing:v0.41.0-3300-d3e6 \
moonbeamfoundation/moonbeam-tracing:v0.42.1-3400-3ebd \
<br>--name="Moonbean-Tracing-Tutorial" \
<br>--unsafe-rpc-external \
<br>--ethapi=debug,trace,txpool \
Expand All @@ -12,7 +12,7 @@
<br>
<span data-ty>CLI parameter `--execution` has no effect anymore and will be removed in the future!
<br> 2024-04-29 13:52:00 Moonbeam Parachain Collator
<br> 2024-04-29 13:52:00 ✌️ version 0.41.0-bb266a27cb9c
<br> 2024-04-29 13:52:00 ✌️ version 0.42.1-bb266a27cb9c
<br> 2024-04-29 13:52:00 ❤️ by PureStake, 2019-2024
<br> 2024-04-29 13:52:00 📋 Chain specification: Moonbase Development Testnet
<br> 2024-04-29 13:52:00 🏷 Node name: Moonbean-Tracing-Tutorial
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const main = async () => {
}
);

console.log('🕔 Subscrition set up. Waiting for new logs');
console.log('🕔 Subscription set up. Waiting for new logs');

subscsription.on('connected', function (subscriptionId) {
console.log(subscriptionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const main = async () => {
}
);

console.log("🕔 Subscrition set up. Waiting for new logs")
console.log("🕔 Subscription set up. Waiting for new logs")

subscription.on('connected', function (subscriptionId) {
console.log(subscriptionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Identity constant IDENTITY_CONTRACT = Identity(IDENTITY_ADDRESS);
interface Identity {
/// @dev Associated raw data.
struct Data {
/// Is `true` if it represents data, else the absense of data is represented by `false`.
/// Is `true` if it represents data, else the absence of data is represented by `false`.
bool hasData;
/// The contained value.
bytes value;
Expand Down Expand Up @@ -236,7 +236,7 @@ interface Identity {
/// @dev Rename a "sub" identity account of the caller.
/// @custom:selector 452df561
/// @param sub The sub account
/// @param data The new assocaited data
/// @param data The new associated data
function renameSub(address sub, Data memory data) external;

/// @dev Removes a "sub" identity account of the caller.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface ParachainStaking {
/// @return A boolean confirming whether the address is a collator candidate
function isCandidate(address candidate) external view returns (bool);

/// @dev Check whether the specifies address is currently a part of the active set
/// @dev Check whether the specified address is currently a part of the active set
/// @custom:selector 740d7d2a
/// @param candidate the address that we want to confirm is a part of the active set
/// @return A boolean confirming whether the address is a part of the active set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Batch constant BATCH_CONTRACT = Batch(BATCH_ADDRESS);

/// @author The Moonbeam Team
/// @title Batch precompile
/// @dev Allows to perform multiple calls throught one call to the precompile.
/// @dev Allows to perform multiple calls through one call to the precompile.
/// Can be used by EOA to do multiple calls in a single transaction.
/// @custom:address 0x0000000000000000000000000000000000000808
interface Batch {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="termynal" data-termynal>
<span data-ty="input"><span class="file-path"></span>node_modules/.bin/substrate-api-sidecar</span>
<br>
<span data-ty>v0.41.0: Pulling from moonbeamfoundation/moonbeam
<span data-ty>v0.42.1: Pulling from moonbeamfoundation/moonbeam
<br>SAS:
<br>📦 LOG:
<br> ✅ LEVEL: "info"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ApiPromise, WsProvider } from '@polkadot/api';

const main = async () => {
// Construct API provider
const wsProvider = new WsProvider('INSERT_WSS_ENDPOINT');
const api = await ApiPromise.create({ provider: wsProvider });

// Define the multilocation parameter
const multilocation = {
V4: {
parents: 1,
interior: 'Here',
},
};

// Query the locationToAccountApi using convertLocation method
const result =
await api.call.locationToAccountApi.convertLocation(multilocation);
console.log('Conversion result:', result.toHuman());

// Disconnect the API
await api.disconnect();
};

main().catch(console.error);
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ interface XcmTransactorV1 {
/// Transact through XCM using fee based on its multilocation through signed origins
/// @custom:selector 71d31587
/// @dev No token is burnt before sending the message. The caller must ensure the destination
/// is able to undertand the DescendOrigin message, and create a unique account from which
/// is able to understand the DescendOrigin message, and create a unique account from which
/// dispatch the call
/// @param dest The destination chain (as multilocation) where to send the message
/// @param feeLocation The asset multilocation that indentifies the fee payment currency
Expand All @@ -124,7 +124,7 @@ interface XcmTransactorV1 {
/// Transact through XCM using fee based on its erc20 address through signed origins
/// @custom:selector 42ca339d
/// @dev No token is burnt before sending the message. The caller must ensure the destination
/// is able to undertand the DescendOrigin message, and create a unique account from which
/// is able to understand the DescendOrigin message, and create a unique account from which
/// dispatch the call
/// @param dest The destination chain (as multilocation) where to send the message
/// @param feeLocationAddress The ERC20 address of the token we want to use to pay for fees
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ interface XcmTransactorV2 {
/// Transact through XCM using fee based on its multilocation through signed origins
/// @custom:selector d7ab340c
/// @dev No token is burnt before sending the message. The caller must ensure the destination
/// is able to undertand the DescendOrigin message, and create a unique account from which
/// is able to understand the DescendOrigin message, and create a unique account from which
/// dispatch the call
/// @param dest The destination chain (as multilocation) where to send the message
/// @param feeLocation The asset multilocation that indentifies the fee payment currency
Expand All @@ -120,7 +120,7 @@ interface XcmTransactorV2 {
/// Transact through XCM using fee based on its erc20 address through signed origins
/// @custom:selector b648f3fe
/// @dev No token is burnt before sending the message. The caller must ensure the destination
/// is able to undertand the DescendOrigin message, and create a unique account from which
/// is able to understand the DescendOrigin message, and create a unique account from which
/// dispatch the call
/// @param dest The destination chain (as multilocation) where to send the message
/// @param feeLocationAddress The ERC20 address of the token we want to use to pay for fees
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ interface XcmTransactorV3 {
/// Transact through XCM using fee based on its multilocation through signed origins
/// @custom:selector 27b1d492
/// @dev No token is burnt before sending the message. The caller must ensure the destination
/// is able to undertand the DescendOrigin message, and create a unique account from which
/// is able to understand the DescendOrigin message, and create a unique account from which
/// dispatch the call
/// @param dest The destination chain (as multilocation) where to send the message
/// @param feeLocation The asset multilocation that indentifies the fee payment currency
Expand All @@ -134,7 +134,7 @@ interface XcmTransactorV3 {
/// Transact through XCM using fee based on its erc20 address through signed origins
/// @custom:selector b18270cf
/// @dev No token is burnt before sending the message. The caller must ensure the destination
/// is able to undertand the DescendOrigin message, and create a unique account from which
/// is able to understand the DescendOrigin message, and create a unique account from which
/// dispatch the call
/// @param dest The destination chain (as multilocation) where to send the message
/// @param feeLocationAddress The ERC20 address of the token we want to use to pay for fees
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Dry run XCM result: {
"ok": {
"executionResult": {
"ok": {
"actualWeight": {
"refTime": 7301615000,
"proofSize": 20928
},
"paysFee": "Yes"
}
},
"emittedEvents": [
{
"index": "0x030b",
"data": [
"0x88bcE0b038eFFa09e58fE6d24fDe4b5Af21aa798",
"0x0000000000000000016345785d8a0000"
]
},
{
"index": "0x0300",
"data": [
"0x3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0",
"0x0000000000000000016345785d8a0000"
]
},
{
"index": "0x030a",
"data": [
"0x3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0",
"0x0000000000000000016345785d8a0000"
]
},
{
"index": "0x1c00",
"data": [
{
"complete": {
"used": {
"refTime": 7250000000,
"proofSize": 19374
}
}
}
]
}
],
"localXcm": {
"v4": [
{
"withdrawAsset": [
{
"id": {
"parents": 0,
"interior": {
"x1": [
{
"palletInstance": 3
}
]
}
},
"fun": {
"fungible": "0x0000000000000000016345785d8a0000"
}
}
]
},
{
"depositAsset": {
"assets": {
"wild": {
"allCounted": 1
}
},
"beneficiary": {
"parents": 0,
"interior": {
"x1": [
{
"accountKey20": {
"network": null,
"key": "0x3cd0a705a2dc65e5b1e1205896baa2be8a07c6e0"
}
}
]
}
}
}
}
]
} // Additional events returned here
// Omitted for clarity
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { ApiPromise, WsProvider } from '@polkadot/api';
import { hexToU8a } from '@polkadot/util';

const main = async () => {
try {
// Construct API provider
const wsProvider = new WsProvider('INSERT_WSS_ENDPOINT');
const api = await ApiPromise.create({ provider: wsProvider });

console.log('Connected to the API. Preparing dry run call...');

// Create a test account (you should replace this with an actual account)
const testAccount = api.createType(
'AccountId20',
'0x88bcE0b038eFFa09e58fE6d24fDe4b5Af21aa798'
);

// The call data (replace with your actual call data)
const callData =
'0x1c030408000400010403001300008a5d784563010d010204000103003cd0a705a2dc65e5b1e1205896baa2be8a07c6e007803822b001ba2e0100'; // Your hex-encoded call data

// Convert hex to Uint8Array
const callDataU8a = hexToU8a(callData);

// Perform the dry run call
const result = await api.call.dryRunApi.dryRunCall(
{ system: { Signed: testAccount } }, // origin
callDataU8a // call
);

console.log(
'Dry run XCM result:',
JSON.stringify(result.toJSON(), null, 2)
);

// Disconnect the API
await api.disconnect();
console.log('Disconnected from the API.');
} catch (error) {
console.error('An error occurred:', error);
}
};

main().catch(console.error);
Loading

0 comments on commit ca6a7cb

Please sign in to comment.