-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feat/feature flags #22
Open
dapp-whisperer
wants to merge
15
commits into
defidollar:main
Choose a base branch
from
Badger-Finance:feat/feature-flags
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.
Open
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cdbe967
feat: calcMintWithRen and calcMintWithWbtc will calculate mint amount…
tabshaikh f015dd4
Update README.md
tabshaikh cc6c9df
feat: make redeem work with renWBTC only
tabshaikh cd8e004
Merge branch 'main' of github.com:Badger-Finance/ibbtc
tabshaikh bcfe7ae
chore: comments
tabshaikh d8b95e8
chore: added package.json and script to deploy
tabshaikh 1307d99
separate minting & redeeming flags
dapp-whisperer d291579
remove mint / redeem flags on peaks
dapp-whisperer e0133c4
add guardian to core, mint and redeem flags per peak
dapp-whisperer 89673eb
fixes
dapp-whisperer 557658c
add rights to badger governance
dapp-whisperer 2d1c818
add badger governance rights to peak
dapp-whisperer 994b206
use pausable with hash slot
dapp-whisperer e2f0c1d
back to 50 slots
dapp-whisperer 2093eea
consolidate access logic into AccessControlDefended
dapp-whisperer 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
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
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.6.11; | ||
|
||
contract PausableSlot { | ||
/** | ||
* @dev Emitted when the pause is triggered by `account`. | ||
*/ | ||
event Paused(address account); | ||
|
||
/** | ||
* @dev Emitted when the pause is lifted by `account`. | ||
*/ | ||
event Unpaused(address account); | ||
|
||
bytes32 constant PAUSED_SLOT = keccak256("_paused"); | ||
|
||
/** | ||
* @dev Returns true if the contract is paused, and false otherwise. | ||
*/ | ||
function paused() public view returns (bool _paused) { | ||
bytes32 position = PAUSED_SLOT; | ||
assembly { | ||
_paused := sload(position) | ||
} | ||
} | ||
|
||
function _setPaused(bool _paused) internal { | ||
bytes32 position = PAUSED_SLOT; | ||
assembly { | ||
sstore(position, _paused) | ||
} | ||
} | ||
|
||
/** | ||
* @dev Modifier to make a function callable only when the contract is not paused. | ||
* | ||
* Requirements: | ||
* | ||
* - The contract must not be paused. | ||
*/ | ||
modifier whenNotPaused() { | ||
require(!paused(), "Pausable: paused"); | ||
_; | ||
} | ||
|
||
/** | ||
* @dev Modifier to make a function callable only when the contract is paused. | ||
* | ||
* Requirements: | ||
* | ||
* - The contract must be paused. | ||
*/ | ||
modifier whenPaused() { | ||
require(paused(), "Pausable: not paused"); | ||
_; | ||
} | ||
|
||
/** | ||
* @dev Triggers stopped state. | ||
* | ||
* Requirements: | ||
* | ||
* - The contract must not be paused. | ||
*/ | ||
function _pause() internal virtual whenNotPaused { | ||
_setPaused(true); | ||
emit Paused(msg.sender); | ||
} | ||
|
||
/** | ||
* @dev Returns to normal state. | ||
* | ||
* Requirements: | ||
* | ||
* - The contract must be paused. | ||
*/ | ||
function _unpause() internal virtual whenPaused { | ||
_setPaused(false); | ||
emit Unpaused(msg.sender); | ||
} | ||
} |
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.
Why reduce 2 slots?