Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New timegraph tokenomics #1161

Merged
merged 39 commits into from
Oct 17, 2024
Merged

Conversation

ana-junius
Copy link
Contributor

@ana-junius ana-junius commented Oct 2, 2024

Description

The PR implements the new timegraph tokenomics feature. based on the proposal of security. It will fix #1193

@ana-junius ana-junius self-assigned this Oct 3, 2024
@ana-junius ana-junius added the !ci-benchmark Benchmark and commit new weights label Oct 7, 2024
@ana-junius ana-junius marked this pull request as ready for review October 10, 2024 06:54
@ana-junius ana-junius added the ready-for-review PR author(s) done with coding and reviewer[s] can start label Oct 14, 2024
Copy link
Collaborator

@dvc94ch dvc94ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this is fine. @4meta5 any objections?

Comment on lines 89 to 105
/// Default value from runtime configuration
#[pallet::type_value]
pub fn DefaultTimegraphAccount<T: Config>() -> T::AccountId {
T::InitialTimegraphAccount::get()
}

/// Default value from runtime configuration
#[pallet::type_value]
pub fn DefaultRewardPoolAccount<T: Config>() -> T::AccountId {
T::InitialRewardPoolAccount::get()
}

/// Default value from runtime configuration
#[pallet::type_value]
pub fn DefaultThreshold<T: Config>() -> BalanceOf<T> {
T::InitialThreshold::get()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand the need for these additional types. You can just use constants directly as the default value parameter in the storage map

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the tokenomics of timegraph works, we need all these values are set, not empty. For default value, we will set it as different values in different env like testnet/devnet/mainnet.

#[pallet::storage]
#[pallet::getter(fn timegraph_account)]
pub type TimegraphAccount<T: Config> =
StorageValue<_, T::AccountId, ValueQuery, DefaultTimegraphAccount<T>>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
StorageValue<_, T::AccountId, ValueQuery, DefaultTimegraphAccount<T>>;
StorageValue<_, T::AccountId, ValueQuery, T::InitialTimegraphAccount>;

like this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try it.

@ana-junius
Copy link
Contributor Author

@foreseon any comments.

@dvc94ch dvc94ch merged commit 06132e9 into development Oct 17, 2024
@dvc94ch dvc94ch deleted the junius/feat-new-timegraph-tokenomics branch October 17, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!ci-benchmark Benchmark and commit new weights ready-for-review PR author(s) done with coding and reviewer[s] can start
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New timegraph pallet implementation
5 participants