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

Split set_paused_withdraw into pause & unpause #236

Merged
merged 4 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion bridge-token-factory/Cargo.lock

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

2 changes: 1 addition & 1 deletion bridge-token-factory/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bridge-token-factory"
version = "0.2.2"
version = "0.2.3"
authors = ["Near Inc <[email protected]>"]
edition = "2021"
publish = false
Expand Down
20 changes: 16 additions & 4 deletions bridge-token-factory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,30 @@ impl BridgeTokenFactory {
)
}

/// Pause or unpause the withdraw method in the bridge token contract.
/// Pause the withdraw method in the bridge token contract.
///
/// # Arguments
///
/// * `address`: Ethereum address of the token ERC20 contract, in hexadecimal format without `0x`.
/// * `paused`: `true` to pause the withdraw method in the bridge token contract, `false` to unpause.
///
#[access_control_any(roles(Role::DAO, Role::PauseManager))]
pub fn set_paused_withdraw(&mut self, address: String, paused: bool) -> Promise {
pub fn pause_withdraw(&mut self, address: String) -> Promise {
ext_bridge_token::ext(self.get_bridge_token_account_id(address))
.with_static_gas(SET_PAUSED_GAS)
.set_paused(paused)
.set_paused(true)
}

/// Unpause the withdraw method in the bridge token contract.
///
/// # Arguments
///
/// * `address`: Ethereum address of the token ERC20 contract, in hexadecimal format without `0x`.
///
#[access_control_any(roles(Role::DAO, Role::PauseManager))]
pub fn unpause_withdraw(&mut self, address: String) -> Promise {
ext_bridge_token::ext(self.get_bridge_token_account_id(address))
.with_static_gas(SET_PAUSED_GAS)
.set_paused(false)
}

pub fn get_bridge_token_account_id(&self, address: String) -> AccountId {
Expand Down
Loading