-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #809 from moonbeam-foundation/themacexpert/openzep
Open Zeppelin Defender V2 Tutorial
- Loading branch information
Showing
9 changed files
with
99 additions
and
81 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
.snippets/code/builders/build/eth-api/dev-env/openzeppelin/PausableBox.sol
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,37 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; | ||
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | ||
|
||
contract PausableBox is Initializable, PausableUpgradeable, OwnableUpgradeable { | ||
uint256 private value; | ||
|
||
// Emitted when the stored value changes | ||
event ValueChanged(uint256 newValue); | ||
|
||
// Initialize | ||
function initialize() initializer public { | ||
__Ownable_init(_msgSender()); | ||
__Pausable_init_unchained(); | ||
} | ||
|
||
// Stores a new value in the contract | ||
function store(uint256 newValue) whenNotPaused public { | ||
value = newValue; | ||
emit ValueChanged(newValue); | ||
} | ||
|
||
// Reads the last stored value | ||
function retrieve() public view returns (uint256) { | ||
return value; | ||
} | ||
|
||
function pause() public onlyOwner { | ||
_pause(); | ||
} | ||
|
||
function unpause() public onlyOwner { | ||
_unpause(); | ||
} | ||
} |
143 changes: 62 additions & 81 deletions
143
builders/build/eth-api/dev-env/openzeppelin/defender.md
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+516 KB
images/builders/build/eth-api/dev-env/openzeppelin/defender/new/oz-defender-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+354 KB
images/builders/build/eth-api/dev-env/openzeppelin/defender/new/oz-defender-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+449 KB
images/builders/build/eth-api/dev-env/openzeppelin/defender/new/oz-defender-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+525 KB
images/builders/build/eth-api/dev-env/openzeppelin/defender/new/oz-defender-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+308 KB
images/builders/build/eth-api/dev-env/openzeppelin/defender/new/oz-defender-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+305 KB
images/builders/build/eth-api/dev-env/openzeppelin/defender/new/oz-defender-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+485 KB
images/builders/build/eth-api/dev-env/openzeppelin/defender/new/oz-defender-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.