@@ -57,15 +57,60 @@ contract Ownable {
57
57
58
58
}
59
59
60
+ /**
61
+ * @title Pausable
62
+ * @dev Base contract which allows children to implement an emergency stop mechanism.
63
+ */
64
+
65
+ contract Pausable is Ownable {
66
+ event Pause ();
67
+ event Unpause ();
68
+
69
+ bool public paused = false ;
70
+
71
+
72
+ /**
73
+ * @dev Modifier to make a function callable only when the contract is not paused.
74
+ */
75
+ modifier whenNotPaused () {
76
+ require (! paused);
77
+ _;
78
+ }
79
+
80
+ /**
81
+ * @dev Modifier to make a function callable only when the contract is paused.
82
+ */
83
+ modifier whenPaused () {
84
+ require (paused);
85
+ _;
86
+ }
87
+
88
+ /**
89
+ * @dev called by the owner to pause, triggers stopped state
90
+ */
91
+ function pause () onlyOwner whenNotPaused public {
92
+ paused = true ;
93
+ Pause ();
94
+ }
95
+
96
+ /**
97
+ * @dev called by the owner to unpause, returns to normal state
98
+ */
99
+ function unpause () onlyOwner whenPaused public {
100
+ paused = false ;
101
+ Unpause ();
102
+ }
103
+ }
104
+
60
105
61
106
/**
62
107
* @title VanityURL
63
- * @dev The VanityURL contract provides functionality to reserve vanitry URLs.
64
- * Go to https://beta.springrole.com to reserve.
108
+ * @dev The VanityURL contract provides functionality to reserve vanitry URLs.
109
+ * Go to https://beta.springrole.com to reserve.
65
110
*/
66
111
67
112
68
- contract VanityURL is Ownable {
113
+ contract VanityURL is Ownable , Pausable {
69
114
70
115
// This declares a state variable that would store the contract address
71
116
SRTToken public tokenAddress;
@@ -91,6 +136,16 @@ contract VanityURL is Ownable {
91
136
92
137
event VanityReserved (address _from , string _vanity_url );
93
138
139
+ /* function to update Token address */
140
+ function updateTokenAddress (address _tokenAddress ) onlyOwner public {
141
+ tokenAddress = SRTToken (_tokenAddress);
142
+ }
143
+
144
+ /* function to update transferTokenTo */
145
+ function updateTokenTransferAddress (address _transferTokenTo ) onlyOwner public {
146
+ transferTokenTo = _transferTokenTo;
147
+ }
148
+
94
149
/* function to add reserve keyword */
95
150
function addReservedKeyword (string _keyword ) onlyOwner public {
96
151
reservedKeywords[_keyword] = 1 ;
@@ -120,7 +175,7 @@ contract VanityURL is Ownable {
120
175
5. Transfer the token
121
176
6. Update the mapping variables
122
177
*/
123
- function reserve (string _vanity_url ) public {
178
+ function reserve (string _vanity_url ) whenNotPaused public {
124
179
require (checkForValidity (_vanity_url));
125
180
require (vanity_address_mapping[_vanity_url] == address (0x0 ));
126
181
require (bytes (address_vanity_mapping[msg .sender ]).length == 0 );
@@ -155,7 +210,7 @@ contract VanityURL is Ownable {
155
210
5. Update the mapping variables
156
211
*/
157
212
158
- function changeVanityURL (string _vanity_url ) public {
213
+ function changeVanityURL (string _vanity_url ) whenNotPaused public {
159
214
require (bytes (address_vanity_mapping[msg .sender ]).length != 0 );
160
215
require (checkForValidity (_vanity_url));
161
216
require (vanity_address_mapping[_vanity_url] == address (0x0 ));
@@ -167,7 +222,7 @@ contract VanityURL is Ownable {
167
222
/*
168
223
function to change vanity URL owner
169
224
*/
170
- function transferOwnershipForVanityURL (address _to ) public {
225
+ function transferOwnershipForVanityURL (address _to ) whenNotPaused public {
171
226
require (bytes (address_vanity_mapping[_to]).length == 0 );
172
227
address_vanity_mapping[_to] = address_vanity_mapping[msg .sender ];
173
228
vanity_address_mapping[_vanity_url] = _to;
0 commit comments