git.delta.rocks / unique-network / refs/commits / 7c556ae4447e

difftreelog

Smart contract module added

str-mv2020-07-09parent: #55625a7.patch.diff
in: master

7 files changed

modifiedCargo.lockdiffbeforeafterboth
1982 "sha2",1982 "sha2",
1983 "smallvec 1.3.0",1983 "smallvec 1.3.0",
1984 "thiserror",1984 "thiserror",
1985 "unsigned-varint",1985 "unsigned-varint 0.3.3",
1986 "void",1986 "void",
1987 "zeroize",1987 "zeroize",
1988]1988]
2046 "sha2",2046 "sha2",
2047 "smallvec 1.3.0",2047 "smallvec 1.3.0",
2048 "uint",2048 "uint",
2049 "unsigned-varint",2049 "unsigned-varint 0.3.3",
2050 "void",2050 "void",
2051 "wasm-timer",2051 "wasm-timer",
2052]2052]
2086 "libp2p-core",2086 "libp2p-core",
2087 "log",2087 "log",
2088 "parking_lot 0.10.2",2088 "parking_lot 0.10.2",
2089 "unsigned-varint",2089 "unsigned-varint 0.3.3",
2090]2090]
20912091
2092[[package]]2092[[package]]
2437 "sha-1",2437 "sha-1",
2438 "sha2",2438 "sha2",
2439 "sha3",2439 "sha3",
2440 "unsigned-varint",2440 "unsigned-varint 0.3.3",
2441]2441]
24422442
2443[[package]]2443[[package]]
24482448
2449[[package]]2449[[package]]
2450name = "multistream-select"2450name = "multistream-select"
2451version = "0.8.0"2451version = "0.8.2"
2452source = "registry+https://github.com/rust-lang/crates.io-index"2452source = "registry+https://github.com/rust-lang/crates.io-index"
2453checksum = "74cdcf7cfb3402881e15a1f95116cb033d69b33c83d481e1234777f5ef0c3d2c"2453checksum = "c9157e87afbc2ef0d84cc0345423d715f445edde00141c93721c162de35a05e5"
2454dependencies = [2454dependencies = [
2455 "bytes 0.5.4",2455 "bytes 0.5.4",
2456 "futures 0.3.4",2456 "futures 0.3.4",
2457 "log",2457 "log",
2458 "pin-project",2458 "pin-project",
2459 "smallvec 1.3.0",2459 "smallvec 1.3.0",
2460 "unsigned-varint",2460 "unsigned-varint 0.4.0",
2461]2461]
24622462
2463[[package]]2463[[package]]
2516version = "2.0.0-alpha.6"2516version = "2.0.0-alpha.6"
2517dependencies = [2517dependencies = [
2518 "futures 0.3.4",2518 "futures 0.3.4",
2519 "jsonrpc-core",
2519 "log",2520 "log",
2520 "nft-runtime",2521 "nft-runtime",
2522 "pallet-contracts-rpc",
2521 "sc-basic-authorship",2523 "sc-basic-authorship",
2522 "sc-cli",2524 "sc-cli",
2523 "sc-client",2525 "sc-client",
2526 "sc-executor",2528 "sc-executor",
2527 "sc-finality-grandpa",2529 "sc-finality-grandpa",
2528 "sc-network",2530 "sc-network",
2531 "sc-rpc",
2529 "sc-service",2532 "sc-service",
2530 "sc-transaction-pool",2533 "sc-transaction-pool",
2531 "sp-consensus",2534 "sp-consensus",
2548 "frame-system",2551 "frame-system",
2549 "pallet-aura",2552 "pallet-aura",
2550 "pallet-balances",2553 "pallet-balances",
2554 "pallet-contracts",
2555 "pallet-contracts-primitives",
2551 "pallet-grandpa",2556 "pallet-grandpa",
2552 "pallet-nft",2557 "pallet-nft",
2553 "pallet-randomness-collective-flip",2558 "pallet-randomness-collective-flip",
2765 "sp-std",2770 "sp-std",
2766]2771]
2772
2773[[package]]
2774name = "pallet-contracts"
2775version = "2.0.0-alpha.6"
2776source = "registry+https://github.com/rust-lang/crates.io-index"
2777checksum = "7c2bc13b765baa08a15815c0d836fee239fde73252a6c7babc437796eda561f5"
2778dependencies = [
2779 "frame-support",
2780 "frame-system",
2781 "pallet-contracts-primitives",
2782 "parity-scale-codec",
2783 "parity-wasm",
2784 "pwasm-utils",
2785 "serde",
2786 "sp-core",
2787 "sp-io",
2788 "sp-runtime",
2789 "sp-sandbox",
2790 "sp-std",
2791 "wasmi-validation",
2792]
2793
2794[[package]]
2795name = "pallet-contracts-primitives"
2796version = "2.0.0-alpha.6"
2797source = "registry+https://github.com/rust-lang/crates.io-index"
2798checksum = "5216edfd33a69a45bdd79f088563479dfdd6ecfb3c477b0f83955b844251c665"
2799dependencies = [
2800 "parity-scale-codec",
2801 "sp-runtime",
2802 "sp-std",
2803]
2804
2805[[package]]
2806name = "pallet-contracts-rpc"
2807version = "0.8.0-alpha.6"
2808source = "registry+https://github.com/rust-lang/crates.io-index"
2809checksum = "c575d839564073fa5757f9dfe5863b48eb07108ecda63521740b8bd8ed6f05c3"
2810dependencies = [
2811 "jsonrpc-core",
2812 "jsonrpc-core-client",
2813 "jsonrpc-derive",
2814 "pallet-contracts-primitives",
2815 "pallet-contracts-rpc-runtime-api",
2816 "parity-scale-codec",
2817 "serde",
2818 "sp-api",
2819 "sp-blockchain",
2820 "sp-core",
2821 "sp-rpc",
2822 "sp-runtime",
2823]
2824
2825[[package]]
2826name = "pallet-contracts-rpc-runtime-api"
2827version = "0.8.0-alpha.6"
2828source = "registry+https://github.com/rust-lang/crates.io-index"
2829checksum = "747f66dc20367de627c701675c66af0a53b4309df16c9929c0d23d2e27e436ee"
2830dependencies = [
2831 "pallet-contracts-primitives",
2832 "parity-scale-codec",
2833 "sp-api",
2834 "sp-runtime",
2835 "sp-std",
2836]
27672837
2768[[package]]2838[[package]]
2769name = "pallet-finality-tracker"2839name = "pallet-finality-tracker"
2922 "percent-encoding 2.1.0",2992 "percent-encoding 2.1.0",
2923 "serde",2993 "serde",
2924 "static_assertions",2994 "static_assertions",
2925 "unsigned-varint",2995 "unsigned-varint 0.3.3",
2926 "url 2.1.1",2996 "url 2.1.1",
2927]2997]
29282998
2940 "percent-encoding 2.1.0",3010 "percent-encoding 2.1.0",
2941 "serde",3011 "serde",
2942 "static_assertions",3012 "static_assertions",
2943 "unsigned-varint",3013 "unsigned-varint 0.3.3",
2944 "url 2.1.1",3014 "url 2.1.1",
2945]3015]
29463016
2956 "sha-1",3026 "sha-1",
2957 "sha2",3027 "sha2",
2958 "sha3",3028 "sha3",
2959 "unsigned-varint",3029 "unsigned-varint 0.3.3",
2960]3030]
29613031
2962[[package]]3032[[package]]
31373207
3138[[package]]3208[[package]]
3139name = "pin-project"3209name = "pin-project"
3140version = "0.4.9"3210version = "0.4.22"
3141source = "registry+https://github.com/rust-lang/crates.io-index"3211source = "registry+https://github.com/rust-lang/crates.io-index"
3142checksum = "6f6a7f5eee6292c559c793430c55c00aea9d3b3d1905e855806ca4d7253426a2"3212checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17"
3143dependencies = [3213dependencies = [
3144 "pin-project-internal",3214 "pin-project-internal",
3145]3215]
31463216
3147[[package]]3217[[package]]
3148name = "pin-project-internal"3218name = "pin-project-internal"
3149version = "0.4.9"3219version = "0.4.22"
3150source = "registry+https://github.com/rust-lang/crates.io-index"3220source = "registry+https://github.com/rust-lang/crates.io-index"
3151checksum = "8988430ce790d8682672117bc06dda364c0be32d3abd738234f19f3240bad99a"3221checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7"
3152dependencies = [3222dependencies = [
3153 "proc-macro2",3223 "proc-macro2",
3154 "quote 1.0.3",3224 "quote 1.0.3",
3340source = "registry+https://github.com/rust-lang/crates.io-index"3410source = "registry+https://github.com/rust-lang/crates.io-index"
3341checksum = "8e86d370532557ae7573551a1ec8235a0f8d6cb276c7c9e6aa490b511c447485"3411checksum = "8e86d370532557ae7573551a1ec8235a0f8d6cb276c7c9e6aa490b511c447485"
3412
3413[[package]]
3414name = "pwasm-utils"
3415version = "0.12.0"
3416source = "registry+https://github.com/rust-lang/crates.io-index"
3417checksum = "4f7a12f176deee919f4ba55326ee17491c8b707d0987aed822682c821b660192"
3418dependencies = [
3419 "byteorder",
3420 "log",
3421 "parity-wasm",
3422]
33423423
3343[[package]]3424[[package]]
3344name = "quick-error"3425name = "quick-error"
4205 "sp-utils",4286 "sp-utils",
4206 "substrate-prometheus-endpoint",4287 "substrate-prometheus-endpoint",
4207 "thiserror",4288 "thiserror",
4208 "unsigned-varint",4289 "unsigned-varint 0.3.3",
4209 "void",4290 "void",
4210 "wasm-timer",4291 "wasm-timer",
4211 "zeroize",4292 "zeroize",
5179 "syn 1.0.17",5260 "syn 1.0.17",
5180]5261]
5262
5263[[package]]
5264name = "sp-sandbox"
5265version = "0.8.0-alpha.6"
5266source = "registry+https://github.com/rust-lang/crates.io-index"
5267checksum = "6f2441d2ed3b141b74a6eaca28b469420bcd438c3ac43d25eadfe494d905135f"
5268dependencies = [
5269 "parity-scale-codec",
5270 "sp-core",
5271 "sp-io",
5272 "sp-std",
5273 "sp-wasm-interface",
5274 "wasmi",
5275]
51815276
5182[[package]]5277[[package]]
5183name = "sp-serializer"5278name = "sp-serializer"
6081 "futures_codec",6176 "futures_codec",
6082]6177]
6178
6179[[package]]
6180name = "unsigned-varint"
6181version = "0.4.0"
6182source = "registry+https://github.com/rust-lang/crates.io-index"
6183checksum = "669d776983b692a906c881fcd0cfb34271a48e197e4d6cb8df32b05bfc3d3fa5"
60836184
6084[[package]]6185[[package]]
6085name = "untrusted"6186name = "untrusted"
modifiednode/Cargo.tomldiffbeforeafterboth
16futures = '0.3.4'16futures = '0.3.4'
17log = '0.4.8'17log = '0.4.8'
18structopt = '0.3.8'18structopt = '0.3.8'
19jsonrpc-core = '14.0.5'
20
21[dependencies.pallet-contracts-rpc]
22version = '0.8.0-alpha.6'
23
24[dependencies.sc-rpc]
25version = '2.0.0-alpha.6'
1926
20[dependencies.nft-runtime]27[dependencies.nft-runtime]
21path = '../runtime'28path = '../runtime'
modifiednode/src/chain_spec.rsdiffbeforeafterboth
7use sp_finality_grandpa::AuthorityId as GrandpaId;7use sp_finality_grandpa::AuthorityId as GrandpaId;
8use sp_runtime::traits::{Verify, IdentifyAccount};8use sp_runtime::traits::{Verify, IdentifyAccount};
9use sc_service::ChainType;9use sc_service::ChainType;
10use nft_runtime::{ContractsConfig, ContractsSchedule};
1011
11// Note this is the URL for the telemetry server12// Note this is the URL for the telemetry server
12//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";13//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
120 sudo: Some(SudoConfig {121 sudo: Some(SudoConfig {
121 key: root_key,122 key: root_key,
122 }),123 }),
124 contracts: Some(ContractsConfig {
125 gas_price: 1_000_000_000,
126 current_schedule: ContractsSchedule {
127 // enable_println,
128 ..Default::default()
129 },
130 }),
123 }131 }
124}132}
125133
modifiedpallets/nft/Cargo.tomldiffbeforeafterboth

no syntactic changes

modifiedruntime/Cargo.tomldiffbeforeafterboth
14package = 'parity-scale-codec'14package = 'parity-scale-codec'
15version = '1.3.0'15version = '1.3.0'
16
17[dependencies.contracts]
18default-features = false
19package = 'pallet-contracts'
20version = '2.0.0-alpha.6'
21
22[dependencies.contracts-primitives]
23default-features = false
24package = 'pallet-contracts-primitives'
25version = '2.0.0-alpha.6'
1626
17[dependencies.frame-executive]27[dependencies.frame-executive]
18default-features = false28default-features = false
133 'aura/std',143 'aura/std',
134 'balances/std',144 'balances/std',
135 'codec/std',145 'codec/std',
146 'contracts/std',
147 'contracts-primitives/std',
136 'frame-executive/std',148 'frame-executive/std',
137 'frame-support/std',149 'frame-support/std',
138 'grandpa/std',150 'grandpa/std',
modifiedruntime/src/lib.rsdiffbeforeafterboth
35pub use sp_runtime::BuildStorage;35pub use sp_runtime::BuildStorage;
36pub use sp_runtime::{Perbill, Permill};36pub use sp_runtime::{Perbill, Permill};
37pub use timestamp::Call as TimestampCall;37pub use timestamp::Call as TimestampCall;
38pub use contracts::Schedule as ContractsSchedule;
3839
39/// Importing a template pallet40/// Importing a template pallet
40pub use nft;41pub use nft;
201 type AccountStore = System;202 type AccountStore = System;
202}203}
204
205// Contracts price units.
206pub const MILLICENTS: Balance = 1_000_000_000;
207pub const CENTS: Balance = 1_000 * MILLICENTS;
208pub const DOLLARS: Balance = 100 * CENTS;
209
210parameter_types! {
211 pub const TombstoneDeposit: Balance = 16 * MILLICENTS;
212 pub const RentByteFee: Balance = 4 * MILLICENTS;
213 pub const RentDepositOffset: Balance = 1000 * MILLICENTS;
214 pub const SurchargeReward: Balance = 150 * MILLICENTS;
215 pub const ContractTransactionBaseFee: Balance = 1 * CENTS;
216 pub const ContractTransactionByteFee: Balance = 10 * MILLICENTS;
217 pub const ContractFee: Balance = 1 * CENTS;
218}
219
220impl contracts::Trait for Runtime {
221 type Currency = Balances;
222 type Time = Timestamp;
223 type Randomness = RandomnessCollectiveFlip;
224 type Call = Call;
225 type Event = Event;
226 type DetermineContractAddress = contracts::SimpleAddressDeterminer<Runtime>;
227 type ComputeDispatchFee = contracts::DefaultDispatchFeeComputor<Runtime>;
228 type TrieIdGenerator = contracts::TrieIdFromParentCounter<Runtime>;
229 type GasPayment = ();
230 type RentPayment = ();
231 type SignedClaimHandicap = contracts::DefaultSignedClaimHandicap;
232 type TombstoneDeposit = TombstoneDeposit;
233 type StorageSizeOffset = contracts::DefaultStorageSizeOffset;
234 type RentByteFee = RentByteFee;
235 type RentDepositOffset = RentDepositOffset;
236 type SurchargeReward = SurchargeReward;
237 type TransactionBaseFee = ContractTransactionBaseFee;
238 type TransactionByteFee = ContractTransactionByteFee;
239 type ContractFee = ContractFee;
240 type CallBaseFee = contracts::DefaultCallBaseFee;
241 type InstantiateBaseFee = contracts::DefaultInstantiateBaseFee;
242 type MaxDepth = contracts::DefaultMaxDepth;
243 type MaxValueSize = contracts::DefaultMaxValueSize;
244 type BlockGasLimit = contracts::DefaultBlockGasLimit;
245}
203246
204parameter_types! {247parameter_types! {
205 pub const TransactionBaseFee: Balance = 0;248 pub const TransactionBaseFee: Balance = 0;
229 pub enum Runtime where272 pub enum Runtime where
230 Block = Block,273 Block = Block,
231 NodeBlock = opaque::Block,274 NodeBlock = opaque::Block,
232 UncheckedExtrinsic = UncheckedExtrinsic275 UncheckedExtrinsic = UncheckedExtrinsic,
233 {276 {
234 System: system::{Module, Call, Config, Storage, Event<T>},277 System: system::{Module, Call, Config, Storage, Event<T>},
235 RandomnessCollectiveFlip: randomness_collective_flip::{Module, Call, Storage},278 RandomnessCollectiveFlip: randomness_collective_flip::{Module, Call, Storage},
239 Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},282 Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
240 TransactionPayment: transaction_payment::{Module, Storage},283 TransactionPayment: transaction_payment::{Module, Storage},
241 Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},284 Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},
285 Contracts: contracts::{Module, Call, Config<T>, Storage, Event<T>},
242 // Used for the module template in `./template.rs`286 // Used for the module template in `./template.rs`
243 Nft: nft::{Module, Call, Storage, Event<T>},287 Nft: nft::{Module, Call, Storage, Event<T>},
244 }288 }
modifiedsmart_contract/nft/Cargo.tomldiffbeforeafterboth
10ink_primitives = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_primitives", default-features = false }10ink_primitives = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_primitives", default-features = false }
11ink_core = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_core", default-features = false }11ink_core = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_core", default-features = false }
12ink_lang = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_lang", default-features = false }12ink_lang = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_lang", default-features = false }
13scale = { package = "parity-scale-codec", version = "1.2", default-features = false, features = ["derive"] }13scale = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive"] }
1414
15sp-core = { git = "https://github.com/paritytech/substrate/", package = "sp-core", default-features = false }15sp-core = { git = "https://github.com/paritytech/substrate/", package = "sp-core", default-features = false }
16sp-runtime = { git = "https://github.com/paritytech/substrate/", package = "sp-runtime", default-features = false }16sp-runtime = { git = "https://github.com/paritytech/substrate/", package = "sp-runtime", default-features = false }