Skip to content

Commit bbd0fdd

Browse files
committed
Merge branch 'master' into 0xlucca/update-deps-050625
2 parents 13cf6e1 + 831198d commit bbd0fdd

File tree

276 files changed

+32140
-18515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+32140
-18515
lines changed

.CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ To set up the structure, follow these steps:
6868

6969
This command will install all dependencies listed in the `requirements.txt` file.
7070

71-
2. Switch to the polkadot-docs directory and use [npm](https://docs.npmjs.com/about-npm) to install dependencies:
71+
2. Switch to the `polkadot-docs` directory and use [npm](https://docs.npmjs.com/about-npm) to install dependencies:
7272

7373
```bash
7474
cd polkadot-docs && npm install

.snippets/code/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.snippets/code/develop/parachains/get-started/install-polkadot-sdk/termynal-2.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44
<br />
55
<span data-ty>active toolchain</span>
66
<span data-ty>----------------</span>
7-
<br />
8-
<span data-ty>stable-x86_64-apple-darwin (default)</span>
9-
<span data-ty>rustc 1.81.0 (eeb90cda1 2024-09-04)</span>
10-
<br />
11-
<span data-ty>...</span>
12-
<br />
13-
<span data-ty>active toolchain</span>
14-
<span data-ty>----------------</span>
15-
<br />
16-
<span data-ty>nightly-x86_64-apple-darwin (overridden by +toolchain on the command line)</span>
17-
<span data-ty>rustc 1.83.0-nightly (6c6d21008 2024-09-22)</span>
7+
<span data-ty>name: stable-aarch64-apple-darwin</span>
8+
<span data-ty>active because: it's the default toolchain</span>
9+
<span data-ty>installed targets:</span>
10+
<span data-ty> aarch64-apple-darwin</span>
11+
<span data-ty> wasm32-unknown-unknown</span>
1812
</div>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity ^0.8.0;
4+
5+
contract Incrementer {
6+
uint256 public number;
7+
8+
constructor(uint256 _initialNumber) {
9+
number = _initialNumber;
10+
}
11+
12+
function increment(uint256 _value) public {
13+
number = number + _value;
14+
}
15+
16+
function reset() public {
17+
number = 0;
18+
}
19+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// hardhat.config.js
2+
require('@nomicfoundation/hardhat-toolbox');
3+
4+
require('@parity/hardhat-polkadot');
5+
6+
/** @type import('hardhat/config').HardhatUserConfig */
7+
module.exports = {
8+
solidity: '0.8.28',
9+
resolc: {
10+
compilerSource: 'binary',
11+
settings: {
12+
compilerPath: 'INSERT_PATH_TO_RESOLC_COMPILER',
13+
},
14+
},
15+
networks: {
16+
hardhat: {
17+
polkavm: true,
18+
nodeConfig: {
19+
nodeBinaryPath: 'INSERT_PATH_TO_SUBSTRATE_NODE',
20+
rpcPort: 8000,
21+
dev: true,
22+
},
23+
adapterConfig: {
24+
adapterBinaryPath: 'INSERT_PATH_TO_ETH_RPC_ADAPTER',
25+
dev: true,
26+
},
27+
},
28+
localNode: {
29+
polkavm: true,
30+
url: `http://127.0.0.1:8545`,
31+
},
32+
polkadotHubTestnet: {
33+
polkavm: true,
34+
url: 'https://testnet-passet-hub-eth-rpc.polkadot.io',
35+
accounts: [process.env.PRIVATE_KEY],
36+
},
37+
},
38+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const { JsonRpcProvider } = require('ethers');
2+
const provider = new JsonRpcProvider('http://localhost:8545');
3+
const wallet = new ethers.Wallet('INSERT_PRIVATE_KEY', provider);
4+
5+
// Deploy using direct provider instead of Hardhat's wrapper
6+
const ContractFactory = new ethers.ContractFactory(
7+
contractABI,
8+
contractBytecode,
9+
wallet,
10+
);
11+
const contract = await ContractFactory.deploy(...constructorArgs);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div id="termynal" data-termynal>
2+
<span data-ty="input"><span class="file-path"></span>npx hardhat node</span>
3+
<br />
4+
<span data-ty>Starting server at 127.0.0.1:8000</span>
5+
<span data-ty>../bin/substrate-node --rpc-port=8000 --dev</span>
6+
<span data-ty>Starting the Eth RPC Adapter at 127.0.0.1:8545</span>
7+
<span data-ty>../bin/eth-rpc --node-rpc-url=ws://localhost:8000 --dev</span>
8+
<span data-ty>2025-05-29 13:00:32 Running in --dev mode, RPC CORS has been disabled.</span>
9+
<span data-ty>2025-05-29 13:00:32 Running in --dev mode, RPC CORS has been disabled.</span>
10+
<span data-ty>2025-05-29 13:00:32 🌐 Connecting to node at: ws://localhost:8000 ...</span>
11+
<span data-ty>2025-05-29 13:00:32 Substrate Node</span>
12+
<span data-ty>2025-05-29 13:00:32 ✌️ version 3.0.0-dev-f73c228b7a1</span>
13+
<span data-ty>2025-05-29 13:00:32 ❤️ by Parity Technologies &lt;[email protected]&gt;, 2017-2025</span>
14+
<span data-ty>2025-05-29 13:00:32 📋 Chain specification: Development</span>
15+
<span data-ty>2025-05-29 13:00:32 🏷 Node name: electric-activity-4221</span>
16+
<span data-ty>2025-05-29 13:00:32 👤 Role: AUTHORITY</span>
17+
<span data-ty>2025-05-29 13:00:32 💾 Database: RocksDb at /var/folders/f4/7rdt2m9d7j361dm453cpggbm0000gn/T/substrateOaoecu/chains/dev/db/full</span>
18+
<span data-ty>2025-05-29 13:00:36 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators</span>
19+
<span data-ty>...</span>
20+
</div>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// hardhat.config.js
2+
require('@nomicfoundation/hardhat-toolbox');
3+
4+
require('@parity/hardhat-polkadot');
5+
6+
/** @type import('hardhat/config').HardhatUserConfig */
7+
module.exports = {
8+
solidity: '0.8.28',
9+
resolc: {
10+
compilerSource: 'npm',
11+
},
12+
networks: {
13+
hardhat: {
14+
polkavm: true,
15+
nodeConfig: {
16+
nodeBinaryPath: 'INSERT_PATH_TO_SUBSTRATE_NODE',
17+
rpcPort: 8000,
18+
dev: true,
19+
},
20+
adapterConfig: {
21+
adapterBinaryPath: 'INSERT_PATH_TO_ETH_RPC_ADAPTER',
22+
dev: true,
23+
},
24+
},
25+
localNode: {
26+
polkavm: true,
27+
url: `http://127.0.0.1:8545`,
28+
},
29+
polkadotHubTestnet: {
30+
polkavm: true,
31+
url: 'https://testnet-passet-hub-eth-rpc.polkadot.io',
32+
accounts: [vars.get('PRIVATE_KEY')],
33+
},
34+
},
35+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const hre = require('hardhat');
2+
3+
async function main() {
4+
// Get the contract factory
5+
const MyToken = await hre.ethers.getContractFactory('MyToken');
6+
7+
// Replace with your deployed contract address
8+
const contractAddress = 'INSERT_CONTRACT_ADDRESS';
9+
10+
// Attach to existing contract
11+
const token = await MyToken.attach(contractAddress);
12+
13+
// Get signers
14+
const [deployer] = await hre.ethers.getSigners();
15+
16+
// Read contract state
17+
const name = await token.name();
18+
const symbol = await token.symbol();
19+
const totalSupply = await token.totalSupply();
20+
const balance = await token.balanceOf(deployer.address);
21+
22+
console.log(`Token: ${name} (${symbol})`);
23+
console.log(
24+
`Total Supply: ${hre.ethers.formatUnits(totalSupply, 18)} tokens`,
25+
);
26+
console.log(
27+
`Deployer Balance: ${hre.ethers.formatUnits(balance, 18)} tokens`,
28+
);
29+
}
30+
31+
main().catch((error) => {
32+
console.error(error);
33+
process.exitCode = 1;
34+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This setup uses Hardhat Ignition to manage smart contract deployments.
2+
// Learn more about it at https://hardhat.org/ignition
3+
4+
const { buildModule } = require('@nomicfoundation/hardhat-ignition/modules');
5+
6+
const JAN_1ST_2030 = 18934560000000;
7+
const ONE_GWEI = 1_000_000_000n;
8+
9+
module.exports = buildModule('LockModule', (m) => {
10+
const unlockTime = m.getParameter('unlockTime', JAN_1ST_2030);
11+
const lockedAmount = m.getParameter('lockedAmount', ONE_GWEI);
12+
13+
const lock = m.contract('Lock', [unlockTime], {
14+
value: lockedAmount,
15+
});
16+
17+
return { lock };
18+
});

0 commit comments

Comments
 (0)