Skip to content

Commit

Permalink
multisig: pause processing/deposits
Browse files Browse the repository at this point in the history
  • Loading branch information
CostinCarabas committed Oct 24, 2024
1 parent 82f653e commit ae4c0dc
Show file tree
Hide file tree
Showing 11 changed files with 347 additions and 129 deletions.
27 changes: 0 additions & 27 deletions common/sc-proxies/src/multi_transfer_esdt_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,31 +301,4 @@ where
.argument(&token_id)
.original_result()
}

pub fn pause_endpoint(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("pause")
.original_result()
}

pub fn unpause_endpoint(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("unpause")
.original_result()
}

pub fn paused_status(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, bool> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("isPaused")
.original_result()
}
}
40 changes: 20 additions & 20 deletions common/sc-proxies/src/multisig_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,93 +702,93 @@ where
.original_result()
}

pub fn pause_all_child_contracts(
pub fn pause_processing(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("pauseAllChildContracts")
.raw_call("pauseProcessing")
.original_result()
}

pub fn unpause_all_child_contracts(
pub fn unpause_processing(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("unpauseAllChildContracts")
.raw_call("unpauseProcessing")
.original_result()
}

pub fn pause_esdt_safe(
pub fn pause_deposits(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("pauseEsdtSafe")
.raw_call("pauseDeposits")
.original_result()
}

pub fn unpause_esdt_safe(
pub fn unpause_deposits(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("unpauseEsdtSafe")
.raw_call("unpauseDeposits")
.original_result()
}

pub fn pause_bridge_proxy(
pub fn pause_esdt_safe(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("pauseBridgeProxy")
.raw_call("pauseEsdtSafe")
.original_result()
}

pub fn unpause_bridge_proxy(
pub fn unpause_esdt_safe(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("unpauseBridgeProxy")
.raw_call("unpauseEsdtSafe")
.original_result()
}

pub fn pause_bridged_tokens_wrapper(
pub fn pause_bridge_proxy(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("pauseBridgedTokensWrapper")
.raw_call("pauseBridgeProxy")
.original_result()
}

pub fn unpause_bridged_tokens_wrapper(
pub fn unpause_bridge_proxy(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("unpauseBridgedTokensWrapper")
.raw_call("unpauseBridgeProxy")
.original_result()
}

pub fn pause_multi_transfer_esdt(
pub fn pause_bridged_tokens_wrapper(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("pauseMultiTransferEsdt")
.raw_call("pauseBridgedTokensWrapper")
.original_result()
}

pub fn unpause_multi_transfer_esdt(
pub fn unpause_bridged_tokens_wrapper(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("unpauseMultiTransferEsdt")
.raw_call("unpauseBridgedTokensWrapper")
.original_result()
}

Expand Down
4 changes: 1 addition & 3 deletions multi-transfer-esdt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const CHAIN_SPECIFIC_TO_UNIVERSAL_TOKEN_MAPPING: &[u8] = b"chainSpecificToUniver

#[multiversx_sc::contract]
pub trait MultiTransferEsdt:
tx_batch_module::TxBatchModule
+ max_bridged_amount_module::MaxBridgedAmountModule
+ multiversx_sc_modules::pause::PauseModule
tx_batch_module::TxBatchModule + max_bridged_amount_module::MaxBridgedAmountModule
{
#[init]
fn init(&self) {
Expand Down
7 changes: 2 additions & 5 deletions multi-transfer-esdt/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

// Init: 1
// Upgrade: 1
// Endpoints: 22
// Endpoints: 19
// Async Callback (empty): 1
// Total number of exported functions: 25
// Total number of exported functions: 22

#![no_std]

Expand Down Expand Up @@ -39,9 +39,6 @@ multiversx_sc_wasm_adapter::endpoints! {
getLastBatchId => last_batch_id
setMaxBridgedAmount => set_max_bridged_amount
getMaxBridgedAmount => max_bridged_amount
pause => pause_endpoint
unpause => unpause_endpoint
isPaused => paused_status
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,74 @@
"status": "0"
}
},
{
"step": "scCall",
"id": "",
"tx": {
"from": "address:owner",
"to": "sc:multi-transfer",
"function": "ChangeOwnerAddress",
"arguments": [
"0x000000000000000005006d756c74697369675f5f5f5f5f5f5f5f5f5f5f5f5f5f"
],
"gasLimit": "5,000,000"
},
"expect": {
"out": [],
"status": "0"
}
},
{
"step": "scCall",
"id": "",
"tx": {
"from": "address:owner",
"to": "sc:esdt-safe",
"function": "ChangeOwnerAddress",
"arguments": [
"0x000000000000000005006d756c74697369675f5f5f5f5f5f5f5f5f5f5f5f5f5f"
],
"gasLimit": "5,000,000"
},
"expect": {
"out": [],
"status": "0"
}
},
{
"step": "scCall",
"id": "",
"tx": {
"from": "address:owner",
"to": "sc:bridge-proxy",
"function": "ChangeOwnerAddress",
"arguments": [
"0x000000000000000005006d756c74697369675f5f5f5f5f5f5f5f5f5f5f5f5f5f"
],
"gasLimit": "5,000,000"
},
"expect": {
"out": [],
"status": "0"
}
},
{
"step": "scCall",
"id": "",
"tx": {
"from": "address:owner",
"to": "sc:bridged-tokens-wrapper",
"function": "ChangeOwnerAddress",
"arguments": [
"0x000000000000000005006d756c74697369675f5f5f5f5f5f5f5f5f5f5f5f5f5f"
],
"gasLimit": "5,000,000"
},
"expect": {
"out": [],
"status": "0"
}
},
{
"step": "scCall",
"id": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,74 @@
"status": "0"
}
},
{
"step": "scCall",
"id": "",
"tx": {
"from": "address:owner",
"to": "sc:multi-transfer",
"function": "ChangeOwnerAddress",
"arguments": [
"0x000000000000000005006d756c74697369675f5f5f5f5f5f5f5f5f5f5f5f5f5f"
],
"gasLimit": "5,000,000"
},
"expect": {
"out": [],
"status": "0"
}
},
{
"step": "scCall",
"id": "",
"tx": {
"from": "address:owner",
"to": "sc:esdt-safe",
"function": "ChangeOwnerAddress",
"arguments": [
"0x000000000000000005006d756c74697369675f5f5f5f5f5f5f5f5f5f5f5f5f5f"
],
"gasLimit": "5,000,000"
},
"expect": {
"out": [],
"status": "0"
}
},
{
"step": "scCall",
"id": "",
"tx": {
"from": "address:owner",
"to": "sc:bridge-proxy",
"function": "ChangeOwnerAddress",
"arguments": [
"0x000000000000000005006d756c74697369675f5f5f5f5f5f5f5f5f5f5f5f5f5f"
],
"gasLimit": "5,000,000"
},
"expect": {
"out": [],
"status": "0"
}
},
{
"step": "scCall",
"id": "",
"tx": {
"from": "address:owner",
"to": "sc:bridged-tokens-wrapper",
"function": "ChangeOwnerAddress",
"arguments": [
"0x000000000000000005006d756c74697369675f5f5f5f5f5f5f5f5f5f5f5f5f5f"
],
"gasLimit": "5,000,000"
},
"expect": {
"out": [],
"status": "0"
}
},
{
"step": "scCall",
"id": "",
Expand Down
Loading

0 comments on commit ae4c0dc

Please sign in to comment.