Skip to content

Commit acdc77f

Browse files
authored
Merge pull request #2059 from silva-fj/feature/add-pallet-contracts
Add pallet-contracts integration with Subtensor chain extension
2 parents b710d30 + c6c61e0 commit acdc77f

File tree

11 files changed

+2767
-6
lines changed

11 files changed

+2767
-6
lines changed

Cargo.lock

Lines changed: 88 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ members = [
3232
"primitives/*",
3333
"runtime",
3434
"support/*",
35+
"chain-extensions",
3536
]
3637
resolver = "2"
3738

@@ -68,6 +69,7 @@ subtensor-precompiles = { default-features = false, path = "precompiles" }
6869
subtensor-runtime-common = { default-features = false, path = "common" }
6970
subtensor-swap-interface = { default-features = false, path = "pallets/swap-interface" }
7071
subtensor-transaction-fee = { default-features = false, path = "pallets/transaction-fee" }
72+
subtensor-chain-extensions = { default-features = false, path = "chain-extensions" }
7173

7274
ed25519-dalek = { version = "2.1.0", default-features = false }
7375
async-trait = "0.1"
@@ -115,6 +117,7 @@ expander = "2"
115117
ahash = { version = "0.8", default-features = false }
116118
regex = { version = "1.11.1", default-features = false }
117119
ethereum = { version = "0.18.2", default-features = false }
120+
num_enum = { version = "0.7.4", default-features = false }
118121

119122
frame = { package = "polkadot-sdk-frame", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }
120123
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }
@@ -145,6 +148,7 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk
145148
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }
146149
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }
147150
pallet-root-testing = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }
151+
pallet-contracts = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }
148152

149153
# NPoS
150154
frame-election-provider-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false }

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This repository contains Bittensor's substrate-chain. Subtensor contains the tru
1818
1. Runs Bittensor's [consensus mechanism](./docs/consensus.md);
1919
2. Advertises neuron information, IPs, etc., and
2020
3. Facilitates value transfer via TAO.
21+
4. Supports wasm smart contract functionality via `pallet-contracts` (see [contracts documentation](./docs/contracts.md)).
2122

2223
## System Requirements
2324

chain-extensions/Cargo.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[package]
2+
name = "subtensor-chain-extensions"
3+
version = "0.1.0"
4+
edition.workspace = true
5+
authors = ['Francisco Silva <[email protected]>']
6+
homepage = "https://taostats.io/"
7+
publish = false
8+
repository = "https://github.com/opentensor/subtensor/"
9+
10+
[package.metadata.docs.rs]
11+
targets = ["x86_64-unknown-linux-gnu"]
12+
13+
[dependencies]
14+
frame-support.workspace = true
15+
frame-system.workspace = true
16+
log.workspace = true
17+
sp-core.workspace = true
18+
sp-io.workspace = true
19+
sp-runtime.workspace = true
20+
sp-std.workspace = true
21+
codec = { workspace = true, features = ["derive"] }
22+
scale-info = { workspace = true, features = ["derive"] }
23+
subtensor-runtime-common.workspace = true
24+
pallet-contracts.workspace = true
25+
pallet-subtensor.workspace = true
26+
pallet-subtensor-swap.workspace = true
27+
pallet-balances.workspace = true
28+
pallet-scheduler.workspace = true
29+
pallet-preimage.workspace = true
30+
pallet-timestamp.workspace = true
31+
pallet-crowdloan.workspace = true
32+
pallet-subtensor-utility.workspace = true
33+
pallet-subtensor-proxy.workspace = true
34+
pallet-drand.workspace = true
35+
subtensor-swap-interface.workspace = true
36+
num_enum.workspace = true
37+
38+
[lints]
39+
workspace = true
40+
41+
[features]
42+
default = ["std"]
43+
std = [
44+
"frame-support/std",
45+
"frame-system/std",
46+
"log/std",
47+
"sp-core/std",
48+
"sp-io/std",
49+
"sp-runtime/std",
50+
"sp-std/std",
51+
"codec/std",
52+
"scale-info/std",
53+
"subtensor-runtime-common/std",
54+
"pallet-contracts/std",
55+
"pallet-subtensor/std",
56+
"pallet-subtensor-swap/std",
57+
"pallet-balances/std",
58+
"pallet-scheduler/std",
59+
"pallet-preimage/std",
60+
"pallet-timestamp/std",
61+
"pallet-crowdloan/std",
62+
"pallet-subtensor-utility/std",
63+
"pallet-subtensor-proxy/std",
64+
"pallet-drand/std",
65+
"subtensor-swap-interface/std",
66+
"num_enum/std",
67+
]

0 commit comments

Comments
 (0)