Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions investment_vault/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,7 @@ impl InvestmentVault {
/// Set the Wormhole core contract address (owner-only) (#184).
#[only_owner]
pub fn set_wormhole_core(env: Env, core: Address) {
require_current_state(&env);
env.storage()
.instance()
.set(&BridgeDataKey::WormholeCore, &core);
Expand Down Expand Up @@ -1536,6 +1537,7 @@ impl InvestmentVault {
project_id: u32,
amount: i128,
) -> CarbonCreditCalculation {
require_current_state(&env);
let registry_addr: Address = env.storage().instance().get(&VaultKey::Registry).unwrap();
let registry = registry_interface::Client::new(&env, &registry_addr);
let project = registry.get_project(&project_id);
Expand Down Expand Up @@ -1780,6 +1782,7 @@ impl InvestmentVault {
}

fn fund_project_internal(env: Env, project_id: u32, amount: i128) {
require_current_state(&env);
if amount <= 0 {
panic_with_error!(&env, VaultError::AmountNotPositive);
}
Expand Down Expand Up @@ -1899,6 +1902,7 @@ fn fund_project_internal(env: Env, project_id: u32, amount: i128) {
}

fn receive_yield_internal(env: Env, from: Address, amount: i128) {
require_current_state(&env);
if amount <= 0 {
panic_with_error!(&env, VaultError::YieldAmountNotPositive);
}
Expand Down Expand Up @@ -1928,6 +1932,7 @@ fn receive_yield_internal(env: Env, from: Address, amount: i128) {
}

fn claim_insurance_internal(env: Env, project_id: u32, recipient: Address, amount: i128) {
require_current_state(&env);
if amount <= 0 {
panic_with_error!(&env, VaultError::ClaimAmountNotPositive);
}
Expand Down
1 change: 1 addition & 0 deletions project_registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ impl ProjectRegistry {
status: CertificationStatus,
) {
require_not_paused(&env);
require_current_state(&env);
caller.require_auth();
let whitelister: Address = env.storage().instance().get(&DataKey::Whitelister).unwrap();
let owner: Address = stellar_access::ownable::get_owner(&env).unwrap();
Expand Down
Loading