-
Notifications
You must be signed in to change notification settings - Fork 43
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
Rc/v3.0.1.5 #972
base: rc/v3.0.1
Are you sure you want to change the base?
Rc/v3.0.1.5 #972
Changes from 13 commits
0458214
742664f
9a4f4a8
e04a6f2
efb6797
2028bd6
b5146b4
a2f0007
a1d02b0
cca4b51
94d6506
64319c1
b2beb0d
5258ca5
4f70ada
78df98b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "disable-add-liq" | ||
version = "0.0.0" | ||
authors = ["Dorin Iancu <dorin.iancu@multiversx.com>"] | ||
edition = "2021" | ||
|
||
[lib] | ||
path = "src/lib.rs" | ||
|
||
[dependencies.multiversx-sc] | ||
version = "=0.53.2" | ||
features = ["esdt-token-payment-legacy-decode"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#![no_std] | ||
|
||
multiversx_sc::imports!(); | ||
|
||
pub const ADD_LIQ_ENABLED: bool = false; | ||
pub const ADD_LIQ_DISABLED: bool = true; | ||
|
||
#[multiversx_sc::module] | ||
pub trait DisableAddLiqModule { | ||
#[only_owner] | ||
#[endpoint(enableAddLiq)] | ||
fn enable_add_liq(&self) { | ||
self.add_liq_disabled().set(ADD_LIQ_ENABLED); | ||
} | ||
|
||
#[only_owner] | ||
#[endpoint(disableAddLiq)] | ||
fn disable_add_liq(&self) { | ||
self.add_liq_disabled().set(ADD_LIQ_DISABLED); | ||
} | ||
|
||
fn require_add_liq_enabled(&self) { | ||
require!( | ||
self.add_liq_disabled().get() == ADD_LIQ_ENABLED, | ||
"Add Liquidity is disabled" | ||
); | ||
} | ||
|
||
#[view(isAddLiqDisabled)] | ||
#[storage_mapper("addLiqDisabled")] | ||
fn add_liq_disabled(&self) -> SingleValueMapper<bool>; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though we want to have it disabled, we shouldn't name the storage in a negative manner. I would suggest add_liq_enabled -> and set it to false. It is more clear this way. Also, this way the default would still be disabled, if the storage is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright then. Currently working on something else, will do after.