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

Royalty increase update for v1 collections #631

Merged
merged 9 commits into from
Jan 18, 2024

Conversation

MightOfOaks
Copy link
Member

No description provided.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

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

Comparison is base (f9b1c54) 79.40% compared to head (f218096) 79.48%.

Files Patch % Lines
contracts/sg721-updatable/src/msg.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           release/v1.x     #631      +/-   ##
================================================
+ Coverage         79.40%   79.48%   +0.08%     
================================================
  Files                14       14              
  Lines               971      975       +4     
================================================
+ Hits                771      775       +4     
  Misses              200      200              

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

.circleci/config.yml Outdated Show resolved Hide resolved
@@ -16,8 +16,8 @@ pub struct CollectionInfo<T> {
pub struct RoyaltyInfo {
pub payment_address: Addr,
pub share: Decimal,
pub updated_at: Option<Timestamp>,
Copy link
Contributor

Choose a reason for hiding this comment

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

just want to check with @MightOfOaks to make sure this won't break on read

Copy link
Member Author

Choose a reason for hiding this comment

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

Earlier the code was in sync with a v2 update that we abandoned and was never deployed on chain. So, the v1 contracts that are currently on chain do not have an updated_at attribute in their CollectionInfo.RoyaltyInfo.

The PR basically reverts all the previous changes regarding royalty updates and keeps the update_time separately similar to how it's done for the v2 contracts.

@@ -27,6 +29,7 @@ const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

const CREATION_FEE: u128 = 1_000_000_000;
const MAX_ROYALTY_SHARE_BPS: u64 = 1_000;
const MAX_ROYALTY_SHARE_DELTA_BPS: u64 = 200;
Copy link
Contributor

Choose a reason for hiding this comment

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

this will be a PITA to update, but this may be how we must do it for now

);
// Make sure the share is not increased more than MAX_ROYALTY_SHARE_DELTA_BPS at a time
if share > old_royalty_info.share {
let share_delta = share - old_royalty_info.share;
Copy link
Contributor

Choose a reason for hiding this comment

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

what if share < old_royalty_info.share

Copy link
Member Author

Choose a reason for hiding this comment

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

The reasoning was that the upwards updates are the risky ones that may cause traders to lose money if the change is too steep.

@jhernandezb jhernandezb merged commit 2a10b3a into release/v1.x Jan 18, 2024
5 checks passed
@jhernandezb jhernandezb deleted the serkan/sg721-v1-update branch February 6, 2025 18:29
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.

3 participants