Skip to content

Commit

Permalink
Merge pull request #889 from multiversx/upgrade-annotation
Browse files Browse the repository at this point in the history
Upgrade annotation
  • Loading branch information
andrei-marinica authored Apr 12, 2024
2 parents 7bdcf2f + 0f92c4f commit cb32307
Show file tree
Hide file tree
Showing 25 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion dex/farm-with-locked-rewards/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub trait Farm:
self.try_set_farm_position_migration_nonce(farm_token_mapper);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {
let current_epoch = self.blockchain().get_block_epoch();
self.first_week_start_epoch().set_if_empty(current_epoch);
Expand Down
2 changes: 1 addition & 1 deletion dex/farm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub trait Farm:
self.try_set_farm_position_migration_nonce(farm_token_mapper);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {
let current_epoch = self.blockchain().get_block_epoch();
self.first_week_start_epoch().set_if_empty(current_epoch);
Expand Down
2 changes: 1 addition & 1 deletion dex/governance/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub trait Governance:
self.try_change_price_providers(price_providers);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

#[payable("*")]
Expand Down
2 changes: 1 addition & 1 deletion dex/pair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub trait Pair<ContractReader>:
};
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

#[endpoint(setLpTokenIdentifier)]
Expand Down
2 changes: 1 addition & 1 deletion dex/pair/src/read_pair_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ pub trait ReadPairStorageModule {

SingleValueMapper::<_, _, ManagedAddress>::new_from_address(pair_address, storage_key)
}
}
}
2 changes: 1 addition & 1 deletion dex/price-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub trait PriceDiscovery:
self.set_locking_sc_address(locking_sc_address);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

/// Users can deposit either launched_token or accepted_token.
Expand Down
2 changes: 1 addition & 1 deletion dex/proxy-deployer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ pub trait ProxyDeployer: farm_deploy::FarmDeployModule {
self.farm_template_address().set(&farm_template_address);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}
}
2 changes: 1 addition & 1 deletion dex/router/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub trait Router:
self.owner().set(&self.blockchain().get_caller());
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {
self.state().set(false);
}
Expand Down
5 changes: 4 additions & 1 deletion dex/router/src/multi_pair_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ pub trait MultiPairSwap:
{
#[payable("*")]
#[endpoint(multiPairSwap)]
fn multi_pair_swap(&self, swap_operations: MultiValueEncoded<SwapOperationType<Self::Api>>) -> ManagedVec<EsdtTokenPayment> {
fn multi_pair_swap(
&self,
swap_operations: MultiValueEncoded<SwapOperationType<Self::Api>>,
) -> ManagedVec<EsdtTokenPayment> {
require!(self.is_active(), "Not active");

let (token_id, nonce, amount) = self.call_value().single_esdt().into_tuple();
Expand Down
2 changes: 1 addition & 1 deletion energy-integration/energy-update/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub trait EnergyUpdate {
#[init]
fn init(&self) {}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

#[endpoint(updateFarmsEnergyForUser)]
Expand Down
2 changes: 1 addition & 1 deletion energy-integration/fees-collector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub trait FeesCollector:
self.energy_factory_address().set(&energy_factory_address);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

#[endpoint(claimRewards)]
Expand Down
2 changes: 1 addition & 1 deletion energy-integration/governance-v2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub trait GovernanceV2:
self.try_change_fee_token_id(fee_token);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

/// Propose a list of actions.
Expand Down
2 changes: 1 addition & 1 deletion farm-staking/farm-staking-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ pub trait FarmStakingProxy:
self.lp_token_id().set_if_empty(&lp_token_id);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}
}
2 changes: 1 addition & 1 deletion farm-staking/farm-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub trait FarmStaking:
self.try_set_farm_position_migration_nonce(farm_token_mapper);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {
let current_epoch = self.blockchain().get_block_epoch();
self.first_week_start_epoch().set_if_empty(current_epoch);
Expand Down
2 changes: 1 addition & 1 deletion farm-staking/metabonding-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub trait MetabondingStaking:
.set_if_empty(&locked_asset_factory_address);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

#[payable("*")]
Expand Down
2 changes: 1 addition & 1 deletion locked-asset/distribution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub trait Distribution: global_op::GlobalOperationModule {
.set_if_empty(&locked_asset_factory_address);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

#[only_owner]
Expand Down
2 changes: 1 addition & 1 deletion locked-asset/energy-factory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub trait SimpleLockEnergy:
self.set_paused(true);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

/// Locks a whitelisted token until `unlock_epoch` and receive meta ESDT LOCKED tokens
Expand Down
2 changes: 1 addition & 1 deletion locked-asset/factory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub trait LockedAssetFactory:
self.set_paused(true);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

fn set_extended_attributes_activation_nonce(&self, is_sc_upgrade: bool) {
Expand Down
2 changes: 1 addition & 1 deletion locked-asset/lkmex-transfer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub trait LkmexTransfer:
self.add_permissions(caller, Permissions::OWNER);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

#[endpoint]
Expand Down
2 changes: 1 addition & 1 deletion locked-asset/locked-token-wrapper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub trait LockedTokenWrapper:
self.energy_factory_address().set(&energy_factory_address);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

#[payable("*")]
Expand Down
2 changes: 1 addition & 1 deletion locked-asset/proxy_dex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub trait ProxyDexImpl:
.set_if_empty(&energy_factory_address);
}

#[endpoint]
#[upgrade]
fn upgrade(&self, old_locked_token_id: TokenIdentifier, old_factory_address: ManagedAddress) {
require!(
old_locked_token_id.is_valid_esdt_identifier(),
Expand Down
2 changes: 1 addition & 1 deletion locked-asset/simple-lock-whitelist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub trait SimpleLockWhitelist:
self.transfer_roles_not_set().set(true);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

/// Sets the transfer role for the given address. Defaults to own address.
Expand Down
2 changes: 1 addition & 1 deletion locked-asset/simple-lock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub trait SimpleLock:
#[init]
fn init(&self) {}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

/// Locks any token (including EGLD) until `unlock_epoch` and receive meta ESDT LOCKED tokens.
Expand Down
2 changes: 1 addition & 1 deletion locked-asset/token-unstake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ pub trait TokenUnstakeModule:
self.fees_burn_percentage().set(fees_burn_percentage);
}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}
}
2 changes: 1 addition & 1 deletion pause-all/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub trait PauseAll:
#[init]
fn init(&self) {}

#[endpoint]
#[upgrade]
fn upgrade(&self) {}

#[only_owner]
Expand Down

0 comments on commit cb32307

Please sign in to comment.