Skip to content

Commit

Permalink
Update Vesting Module - Include only SEE and EDF
Browse files Browse the repository at this point in the history
  • Loading branch information
balqaasem committed Feb 19, 2024
1 parent e4d7a41 commit fd1c9c3
Show file tree
Hide file tree
Showing 6 changed files with 554 additions and 745 deletions.
36 changes: 22 additions & 14 deletions blockchain/modules/vesting/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
[package]
name = "module-vesting"
description = "Provides scheduled balance locking mechanism, in a *graded vesting* way."
version = "1.0.0"
version = "0.9.81"
authors = ["Setheum Labs"]
edition = "2018"
edition = "2021"

[dependencies]
serde = { version = "1.0.124", optional = true }
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["max-encoded-len"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10", default-features = false }
scale-info = { workspace = true }
serde = { workspace = true, optional = true }
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] }
sp-runtime = { workspace = true }
sp-io = { workspace = true }
sp-std = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }

primitives = { package = "setheum-primitives", path = "../primitives", default-features = false }
support = { package = "module-support", path = "../support", default-features = false }
orml-traits = { path = "../submodules/orml/traits", default-features = false }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" }
orml-tokens = { path = "../submodules/orml/tokens" }
sp-core = { workspace = true, features = ["std"] }
pallet-balances = { workspace = true }
orml-tokens = { workspace = true }

[features]
default = ["std"]
std = [
"scale-info/std",
"serde",
"codec/std",
"parity-scale-codec/std",
"sp-runtime/std",
"sp-std/std",
"sp-io/std",
Expand All @@ -40,4 +42,10 @@ std = [
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
6 changes: 5 additions & 1 deletion blockchain/modules/vesting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

## Overview

Vesting module provides a means of scheduled balance lock on an account. It uses the *graded vesting* way, which unlocks a specific amount of balance every period of time, until all balance unlocked.
Vesting module provides a means of scheduled balance lock on an account. It uses the *graded vesting* way, which unlocks a specific amount of balance every period of time, until all balance unlocked. The `NativeCurrencyId` (SEE) and `EDFCurrencyId` (EDF) are both supported in this module.

### Vesting Schedule

The schedule of a vesting is described by data structure `VestingSchedule`: from the block number of `start`, of `currency_id`, for every `period` amount of blocks, `per_period` amount of balance would unlocked, until number of periods `period_count` reached. Note in vesting schedules, *time* is measured by block number. All `VestingSchedule`s under an account could be queried in chain state.

### Locks

The implementation uses locks which allow tokens to be locked by other pallets that's also using locks, for example, the conviction-voting pallet.
Loading

0 comments on commit fd1c9c3

Please sign in to comment.