diff --git a/Cargo.lock b/Cargo.lock index f42fe42..4db038c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2198,6 +2198,7 @@ dependencies = [ "pallet-ethereum", "pallet-evm", "pallet-evm-precompile-simple", + "pallet-faucets", "pallet-grandpa", "pallet-identity", "pallet-indices", @@ -3881,7 +3882,7 @@ dependencies = [ [[package]] name = "module-support" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-support", "frame-system", @@ -4229,7 +4230,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4308,7 +4309,7 @@ dependencies = [ [[package]] name = "pallet-bridge" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-support", "frame-system", @@ -4512,6 +4513,23 @@ dependencies = [ "sp-io", ] +[[package]] +name = "pallet-faucets" +version = "3.0.0" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" +dependencies = [ + "frame-support", + "frame-system", + "pallet-balances", + "pallet-nft-multi", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", + "uniarts-primitives", +] + [[package]] name = "pallet-grandpa" version = "3.0.0" @@ -4602,7 +4620,7 @@ dependencies = [ [[package]] name = "pallet-names" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "enumflags2 0.7.1", "frame-support", @@ -4617,7 +4635,7 @@ dependencies = [ [[package]] name = "pallet-nft" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-support", "frame-system", @@ -4638,7 +4656,7 @@ dependencies = [ [[package]] name = "pallet-nft-blindbox" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-support", "frame-system", @@ -4660,7 +4678,7 @@ dependencies = [ [[package]] name = "pallet-nft-multi" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-support", "frame-system", @@ -4745,7 +4763,7 @@ dependencies = [ [[package]] name = "pallet-rewards" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4812,7 +4830,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-support", "frame-system", @@ -4827,7 +4845,7 @@ dependencies = [ [[package]] name = "pallet-staking-rpc" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", @@ -4845,7 +4863,7 @@ dependencies = [ [[package]] name = "pallet-staking-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-support", "parity-scale-codec", @@ -4971,7 +4989,7 @@ dependencies = [ [[package]] name = "pallet-validator-set" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-support", "frame-system", @@ -7138,6 +7156,31 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "scale-info" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c55b744399c25532d63a0d2789b109df8d46fc93752d46b0782991a931a782f" +dependencies = [ + "bitvec", + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" +dependencies = [ + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "schannel" version = "0.1.19" @@ -8971,7 +9014,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.7.3", + "rand 0.3.23", "static_assertions", ] @@ -9045,7 +9088,7 @@ dependencies = [ [[package]] name = "uniarts-common" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "frame-support", "frame-system", @@ -9061,7 +9104,7 @@ dependencies = [ [[package]] name = "uniarts-primitives" version = "3.0.0" -source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.4#4b4733da3db4ef1150db68b7dab5a142ea431fd9" +source = "git+https://github.com/uni-arts-chain/uni-arts-common.git?tag=v3.0.5#6767f97535cbc977bd98c385fc3dac54da4a24b9" dependencies = [ "parity-scale-codec", "serde", diff --git a/bin/cli/Cargo.toml b/bin/cli/Cargo.toml index 9afe118..6cac486 100644 --- a/bin/cli/Cargo.toml +++ b/bin/cli/Cargo.toml @@ -13,7 +13,7 @@ log = { version = "0.4.11" } # uniarts uniarts-service = { path = "../service", default-features = false } -uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" } +uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" } # substratem sp-core = { version = "3.0.0", optional = true } diff --git a/bin/rpc/Cargo.toml b/bin/rpc/Cargo.toml index b2705f4..a0ef6db 100644 --- a/bin/rpc/Cargo.toml +++ b/bin/rpc/Cargo.toml @@ -13,13 +13,13 @@ jsonrpc-pubsub = "15.0.0" futures = "0.3.4" # uniarts -uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" } +uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" } # rpc substrate-frame-rpc-system = { version = "3.0.0" } pallet-transaction-payment-rpc = { version = "3.0.0" } -pallet-staking-rpc = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" } +pallet-staking-rpc = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" } pallet-contracts-rpc = { version = "3.0.0" } # substrate client diff --git a/bin/service/Cargo.toml b/bin/service/Cargo.toml index 16073cf..a7bffe9 100644 --- a/bin/service/Cargo.toml +++ b/bin/service/Cargo.toml @@ -17,7 +17,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = pangu-runtime = { path = "../../runtime/pangu" } fuxi-runtime = { path = "../../runtime/fuxi" } uniarts-rpc = { path = "../rpc" } -uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" } +uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" } # substrate client sc-cli = { version = "0.9.0", features = ["wasmtime"] } @@ -58,7 +58,7 @@ frame-benchmarking-cli = { version = "3.0.0" } substrate-frame-rpc-system = { version = "3.0.0" } substrate-prometheus-endpoint = { version = "0.9.0" } pallet-transaction-payment-rpc = { version = "3.0.0" } -pallet-staking-rpc = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" } +pallet-staking-rpc = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" } pallet-contracts-rpc = { version = "3.0.0" } pallet-contracts = { version = "3.0.0" } diff --git a/primitives/chain/Cargo.toml b/primitives/chain/Cargo.toml index a37985d..8eaeacc 100644 --- a/primitives/chain/Cargo.toml +++ b/primitives/chain/Cargo.toml @@ -13,7 +13,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = sp-core = { version = "3.0.0", default-features = false } sp-runtime = { version = "3.0.0", default-features = false } sp-std = { version = "3.0.0", default-features = false } -uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" , default-features = false } +uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } pallet-evm = { version = "3.0.0-dev", default-features = false, path = "../../pallets/evm" } diff --git a/runtime/fuxi/Cargo.toml b/runtime/fuxi/Cargo.toml index c5e3822..b3edf19 100644 --- a/runtime/fuxi/Cargo.toml +++ b/runtime/fuxi/Cargo.toml @@ -67,20 +67,21 @@ orml-traits = { default-features = false, version = '0.4.0' } # Used for RPCs pallet-transaction-payment-rpc-runtime-api = { version = "3.0.0", default-features = false } -pallet-staking-rpc-runtime-api = { version = "3.0.0", default-features = false, git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" } +pallet-staking-rpc-runtime-api = { version = "3.0.0", default-features = false, git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" } # Uni-Arts configs -uniarts-common = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } -pallet-names = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } -pallet-nft-multi = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } -pallet-nft-blindbox = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } -pallet-rewards = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } -pallet-staking = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } -pallet-validator-set = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } -pallet-bridge = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } -pallet-assets = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" , default-features = false } +uniarts-common = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } +pallet-names = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } +pallet-nft-multi = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } +pallet-nft-blindbox = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } +pallet-rewards = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } +pallet-staking = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } +pallet-validator-set = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } +pallet-bridge = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } +pallet-assets = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } +pallet-faucets = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } # pallet-lotteries = { path = "../../configs/lotteries", default-features = false } -uniarts-primitives = { package = "uniarts-primitives", git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } +uniarts-primitives = { package = "uniarts-primitives", git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } #EVM pallet-ethereum = { version = "0.1.0", default-features = false, path = "../../pallets/ethereum" } @@ -143,6 +144,7 @@ std = [ "pallet-recovery/std", "pallet-nicks/std", "pallet-bridge/std", + "pallet-faucets/std", "orml-currencies/std", "orml-tokens/std", "sp-api/std", diff --git a/runtime/fuxi/src/configs/mod.rs b/runtime/fuxi/src/configs/mod.rs index 118c3cc..52bd030 100644 --- a/runtime/fuxi/src/configs/mod.rs +++ b/runtime/fuxi/src/configs/mod.rs @@ -34,3 +34,4 @@ pub mod pallet_bridge_config; pub mod pallet_proxy_config; pub mod pallet_evm_config; pub mod pallet_ethereum_config; +pub mod pallet_faucets_config; diff --git a/runtime/fuxi/src/configs/pallet_faucets_config.rs b/runtime/fuxi/src/configs/pallet_faucets_config.rs new file mode 100644 index 0000000..30413aa --- /dev/null +++ b/runtime/fuxi/src/configs/pallet_faucets_config.rs @@ -0,0 +1,8 @@ +use pallet_faucets::Config; +use uniarts_primitives::*; +use crate::*; + +impl Config for Runtime { + type Event = Event; + type Currency = Uart; +} \ No newline at end of file diff --git a/runtime/fuxi/src/lib.rs b/runtime/fuxi/src/lib.rs index ad5b87a..f72d755 100644 --- a/runtime/fuxi/src/lib.rs +++ b/runtime/fuxi/src/lib.rs @@ -129,7 +129,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("uart"), impl_name: create_runtime_str!("uart"), authoring_version: 1, - spec_version: 50, + spec_version: 51, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -237,6 +237,7 @@ construct_runtime!( Bridge: pallet_bridge::{Module, Call, Storage, Event, Config} = 65, Ethereum: pallet_ethereum::{Module, Call, Storage, Event, Config, ValidateUnsigned} = 66, EVM: pallet_evm::{Module, Config, Call, Storage, Event} = 67, + Faucets: pallet_faucets::{Module, Call, Storage, Event} = 68, } ); diff --git a/runtime/fuxi/types.json b/runtime/fuxi/types.json index 2f14b21..76d3adf 100644 --- a/runtime/fuxi/types.json +++ b/runtime/fuxi/types.json @@ -288,5 +288,20 @@ "start_time": "BlockNumber", "end_time": "BlockNumber", "has_ended": "bool" + }, + "Faucet": { + "enabled": "bool", + "period": "BlockNumber", + "period_limit": "Balance", + "drip_limit": "Balance", + + "next_period_at": "BlockNumber", + "dripped_in_current_period": "Balance" + }, + "FaucetUpdate": { + "enabled": "Option", + "period": "Option", + "period_limit": "Option", + "drip_limit": "Option" } } \ No newline at end of file diff --git a/runtime/pangu/Cargo.toml b/runtime/pangu/Cargo.toml index 3efe2fa..b95e783 100644 --- a/runtime/pangu/Cargo.toml +++ b/runtime/pangu/Cargo.toml @@ -62,18 +62,18 @@ pallet-contracts-rpc-runtime-api = { version = "3.0.0", default-features = false # Used for RPCs pallet-transaction-payment-rpc-runtime-api = { version = "3.0.0", default-features = false } -pallet-staking-rpc-runtime-api = { version = "3.0.0", default-features = false, git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" } +pallet-staking-rpc-runtime-api = { version = "3.0.0", default-features = false, git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" } # Uni-Arts configs -uniarts-common = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4", default-features = false } -pallet-assets = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" , default-features = false } -pallet-names = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" , default-features = false } -pallet-nft = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" , default-features = false } -pallet-rewards = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" , default-features = false } -pallet-staking = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" , default-features = false } -pallet-validator-set = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" , default-features = false } +uniarts-common = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5", default-features = false } +pallet-assets = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } +pallet-names = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } +pallet-nft = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } +pallet-rewards = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } +pallet-staking = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } +pallet-validator-set = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } # pallet-lotteries = { path = "../../configs/lotteries", default-features = false } -uniarts-primitives = { package = "uniarts-primitives", git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.4" , default-features = false } +uniarts-primitives = { package = "uniarts-primitives", git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.5" , default-features = false } # Used for runtime benchmarking frame-benchmarking = { version = "3.0.0", default-features = false, optional = true }