-
Notifications
You must be signed in to change notification settings - Fork 48
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
Draft
dorin-iancu
wants to merge
26
commits into
main
Choose a base branch
from
rc/v3.0.1.5
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Rc/v3.0.1.5 #972
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
1a27f49
dummy commit
dorin-iancu 0458214
just some cleanup
dorin-iancu 742664f
small fix
dorin-iancu 9a4f4a8
setter
dorin-iancu e04a6f2
disable add liq for old proxy
dorin-iancu efb6797
common module + disable in simple lock
dorin-iancu 2028bd6
remove useless dependency
dorin-iancu b5146b4
change undistributed rewards code
dorin-iancu a2f0007
Merge pull request #969 from multiversx/all-xmex-fees-to-users
dorin-iancu a1d02b0
Merge branch 'rc/v3.0.1.5' into no-more-add-liq-with-locked-tokens
dorin-iancu cca4b51
evil clippy
dorin-iancu 94d6506
Merge pull request #970 from multiversx/no-more-add-liq-with-locked-t…
dorin-iancu 64319c1
Merge branch 'rc/v3.0.1.5' into change-undistributed-rew-code
dorin-iancu b2beb0d
Merge pull request #971 from multiversx/change-undistributed-rew-code
dorin-iancu 5258ca5
additional tests for add liq disabled
dorin-iancu 4f70ada
evil clippy
dorin-iancu 78df98b
Merge pull request #973 from multiversx/additional-tests-add-liq
dorin-iancu d3123dc
change disable add liq code
dorin-iancu 12c7a3a
build
dorin-iancu 3515201
Merge pull request #975 from multiversx/change-negative-storage
dorin-iancu 95f6a63
Merge branch 'main' of https://github.com/multiversx/mx-exchange-sc
dorin-iancu 7ff912d
Merge branch 'main' into merge-rc/v3.0.1.5-with-main
dorin-iancu bfc76cb
Merge pull request #981 from multiversx/merge-rc/v3.0.1.5-with-main
dorin-iancu 94c6de1
Merge branch 'main' of https://github.com/multiversx/mx-exchange-sc
dorin-iancu 5123b19
merge with main
dorin-iancu b280ca1
Merge pull request #1011 from multiversx/merge-rc-3015-with-main
dorin-iancu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]>"] | ||
edition = "2021" | ||
|
||
[lib] | ||
path = "src/lib.rs" | ||
|
||
[dependencies.multiversx-sc] | ||
version = "=0.53.2" | ||
features = ["esdt-token-payment-legacy-decode"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = true; | ||
pub const ADD_LIQ_DISABLED: bool = false; | ||
|
||
#[multiversx_sc::module] | ||
pub trait DisableAddLiqModule { | ||
#[only_owner] | ||
#[endpoint(enableAddLiq)] | ||
fn enable_add_liq(&self) { | ||
self.add_liq_enabled().set(ADD_LIQ_ENABLED); | ||
} | ||
|
||
#[only_owner] | ||
#[endpoint(disableAddLiq)] | ||
fn disable_add_liq(&self) { | ||
self.add_liq_enabled().set(ADD_LIQ_DISABLED); | ||
} | ||
|
||
fn require_add_liq_enabled(&self) { | ||
require!( | ||
self.add_liq_enabled().get() == ADD_LIQ_ENABLED, | ||
"Add Liquidity is disabled" | ||
); | ||
} | ||
|
||
#[view(isAddLiqEnabled)] | ||
#[storage_mapper("addLiqEnabled")] | ||
fn add_liq_enabled(&self) -> SingleValueMapper<bool>; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,3 +124,4 @@ pub trait Pair<ContractReader>: | |
self.lp_token_identifier().set(&token_identifier); | ||
} | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What if this would act in a reverse way? Not add liquidity enabled, but add liquidity paused. So you have to write in storage whenever you want to pause the adding of liquidity. In other words, we would modify only this module, not the implementation in other contracts. We could keep require_add_liq_enabled as is, but check the storage has something instead of being empty.
This would be helpful when upgrading the contracts, so that the owner doesn't need to call the extra allow function.
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.
...it was you who told me to do it this way, in this very same PR, and now you want it the other way again?