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

feat: add possibility to attach deposit for staking in add_release_blob #18

Merged
merged 2 commits into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,14 @@ impl AuroraControllerFactory {
}
}

/// Adds bytes of the contract smart contract to the corresponding release info.
/// Adds bytes of the contract smart contract to the corresponding release info. The attached
/// deposit could be used as a payment for the storage staking.
#[payable]
pub fn add_release_blob(&mut self) {
assert_one_yocto();
require!(
!env::attached_deposit().is_zero(),
"required at least 1 yoctoNEAR"
);
let blob = env::input().unwrap_or_else(|| panic!("no blob's bytes were provided"));
let hash = utils::hash_256(&blob);
let release_info = self.releases.get_mut(&hash).unwrap_or_else(|| {
Expand Down