Skip to content

Commit

Permalink
factory-legacy SC audit updates
Browse files Browse the repository at this point in the history
  • Loading branch information
psorinionut committed Jul 31, 2024
1 parent 28030df commit 6e1623f
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 19 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion legacy-contracts/factory-legacy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ path = "../../common/common_structs"
path = "../../common/common_errors"

[dependencies.token_merge_helper]
path = "../../common/modules/token_merge_helper"
path = "../../common/modules/token_merge_helper"

[dependencies.energy-factory]
path = "../../locked-asset/energy-factory"
20 changes: 2 additions & 18 deletions legacy-contracts/factory-legacy/src/migration.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
multiversx_sc::imports!();

use common_structs::UnlockEpochAmountPairs;

mod energy_factory_proxy {
use common_structs::UnlockEpochAmountPairs;

multiversx_sc::imports!();

#[multiversx_sc::proxy]
pub trait EnergyFactoryProxy {
#[endpoint(updateEnergyAfterOldTokenUnlock)]
fn update_energy_after_old_token_unlock(
&self,
original_caller: ManagedAddress,
initial_epoch_amount_pairs: UnlockEpochAmountPairs<Self::Api>,
final_epoch_amount_pairs: UnlockEpochAmountPairs<Self::Api>,
);
}
}
use energy_factory::migration::ProxyTrait as _;

#[multiversx_sc::module]
pub trait LockedTokenMigrationModule:
Expand Down Expand Up @@ -54,7 +38,7 @@ pub trait LockedTokenMigrationModule:
fn new_factory_proxy_builder(
&self,
sc_address: ManagedAddress,
) -> energy_factory_proxy::Proxy<Self::Api>;
) -> energy_factory::Proxy<Self::Api>;

#[storage_mapper("newFactoryAddress")]
fn new_factory_address(&self) -> SingleValueMapper<ManagedAddress>;
Expand Down
53 changes: 53 additions & 0 deletions legacy-contracts/factory-legacy/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e1623f

Please sign in to comment.