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

[SG-1051] Names renewal #252

Merged
merged 90 commits into from
Jun 3, 2024
Merged

[SG-1051] Names renewal #252

merged 90 commits into from
Jun 3, 2024

Conversation

tasiov
Copy link
Contributor

@tasiov tasiov commented Dec 14, 2023

Changes

Document with testing notes

The purpose of these changes is to implement a working version of Names renewal. Below are some details.

Names Marketplace Sudo Params

The following fields have been added to the Names Marketplace Sudo Params object.

    /// The maximum number of renewals that can be processed in each block
    pub max_renewals_per_block: u32,
    /// The number of bids to query to when searching for the highest bid
    pub valid_bid_query_limit: u32,
    /// The number of seconds before the current block time that a
    /// bid must have been created in order to be considered valid
    pub valid_bid_seconds_delta: u64,
    /// The percentage of the winning bid that must be paid to renew a name
    pub renewal_bid_percentage: Decimal,
    /// The address with permission to invoke process_renewals
    pub operator: String,

Names Marketplace Messages

The following messages were added to the Names Marketplace:

  • ExecuteMsg::MigrateBids
    • Only invokable by the operator address
    • Used to migrate bids from the old index to the new index, which has the token_id prefixes
  • ExecuteMsg::Renew
    • Invokable within a specific time window of the renewal time.
    • Used to fully renew a name
  • ExecuteMsg::ProcessRenewals
    • Only invokable by the operator address
    • Used to process a set of names that are set to renew
  • QueryMsg::AsksByRenewTime
    • Used to query a set of asks by there renew time. Good for checking which will renew soon.
  • QueryMsg::AskRenewPrice
    • Used to query a the renew price of an Ask. Can change over time with bids.
  • QueryMsg::LegacyBids
    • Used to query the legacy bid index, to check if there are bids that need migrating
  • SudoMsg:EndBlock
    • Used to systematically process name renewals

Copy link

linear bot commented Dec 14, 2023

@tasiov tasiov force-pushed the tasiov/sg-1051-names-renewal branch from 0ba011f to 716e36f Compare December 18, 2023 22:01
@tasiov tasiov marked this pull request as ready for review December 18, 2023 22:03
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Attention: 103 lines in your changes are missing coverage. Please review.

Comparison is base (c25419d) 68.29% compared to head (0d18873) 69.70%.

Files Patch % Lines
contracts/marketplace/src/migrate.rs 0.00% 25 Missing ⚠️
contracts/marketplace/src/sudo.rs 0.00% 25 Missing ⚠️
contracts/marketplace/src/execute.rs 77.89% 21 Missing ⚠️
contracts/marketplace/src/query.rs 63.15% 14 Missing ⚠️
contracts/sg721-name/src/contract.rs 42.85% 12 Missing ⚠️
contracts/marketplace/src/helpers.rs 93.02% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #252      +/-   ##
==========================================
+ Coverage   68.29%   69.70%   +1.40%     
==========================================
  Files          25       26       +1     
  Lines        1432     1690     +258     
==========================================
+ Hits          978     1178     +200     
- Misses        454      512      +58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tasiov tasiov force-pushed the tasiov/sg-1051-names-renewal branch from 02c4cdf to 47d9a70 Compare January 2, 2024 21:26
@tasiov tasiov force-pushed the tasiov/sg-1051-names-renewal branch from 47d9a70 to 5f9ef40 Compare January 2, 2024 21:30
@jason-c-child jason-c-child merged commit 3c94c42 into main Jun 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants