feat: implement per-market admin action timelock functionality and as…#889
Merged
greatest0fallt1me merged 2 commits intoJul 24, 2026
Conversation
|
@GiftedGiftB Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…o the top of the implementation block
Contributor
|
Merged into master via admin resolver (-X theirs). |
Contributor
|
LGTM — thoughtful approach, thanks for taking this on! |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #850
Ran command: `python3 -c "
import os
filepath = 'contracts/predictify-hybrid/src/lib.rs'
with open(filepath, 'r') as f:
content = f.read()
First, remove the previously incorrectly injected functions
bad_funcs = ''' pub fn initialize(env: Env, admin: Address, platform_fee_percentage: Option, _allowed_assets: Option<soroban_sdk::Vec
>) -> Result<(), Error> {if env.storage().persistent().has(&Symbol::new(&env, SYM_PLATFORM_FEE)) {
return Err(Error::InvalidState);
}
let fee_percentage = platform_fee_percentage.unwrap_or(crate::config::DEFAULT_PLATFORM_FEE_PERCENTAGE);
if fee_percentage < crate::config::MIN_PLATFORM_FEE_PERCENTAGE || fee_percentage > crate::config::MAX_PLATFORM_FEE_PERCENTAGE {
panic_with_error!(env, Error::InvalidFeeConfig);
}
env.storage().persistent().set(&Symbol::new(&env, SYM_ADMIN), &admin);
env.storage().persistent().set(&Symbol::new(&env, SYM_PLATFORM_FEE), &fee_percentage);
Ok(())
}
content = content.replace(bad_funcs, '')
Now inject it into impl PredictifyHybrid {
insert_target = 'impl PredictifyHybrid {'
insert_pos = content.find(insert_target)
if insert_pos != -1:
insert_pos += len(insert_target)
content = content[:insert_pos] + '\n' + bad_funcs + '\n' + content[insert_pos:]
with open(filepath, 'w') as f:
f.write(content)
"`
Edited pr_documentation.md
I have generated the PR documentation following your requested template and saved it as an artifact.
In addition to preparing the PR documentation, I have also completed the final patches to
lib.rsto fix the test suite. Specifically:initialize,deposit,withdraw, andget_balancemethods directly into theimpl PredictifyHybridblock.IdempotentBatchAlreadyAppliedvariant inerr.rsand thePlaceBetsIdemdata key instorage.rs.MedianResolutionResultstruct to the proper file scope so it could be compiled as a#[contracttype].You can view the full PR documentation in the created artifact here: pr_documentation.md. Feel free to review it, and let me know if you would like me to adjust any sections!