Skip to content

Commit d5b18bb

Browse files
authored
Merge pull request #16 from SpringRole/removing-reserved-keywords
removed reserve keywords logic
2 parents 71bfd05 + c3ac4d3 commit d5b18bb

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

contracts/VanityURL.sol

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ contract VanityURL is Ownable,Pausable {
106106

107107
// This declares a state variable that would store the contract address
108108
Token public tokenAddress;
109-
// This declares a state variable that would store mapping for reserved _keyword
110-
mapping (string => uint) reservedKeywords;
111109
// This declares a state variable that mapping for vanityURL to address
112110
mapping (string => address) vanity_address_mapping;
113111
// This declares a state variable that mapping for address to vanityURL
@@ -140,19 +138,6 @@ contract VanityURL is Ownable,Pausable {
140138
transferTokenTo = _transferTokenTo;
141139
}
142140

143-
/* function to add reserve keyword */
144-
function addReservedKeyword (string _keyword) onlyOwner public {
145-
reservedKeywords[_keyword] = 1;
146-
}
147-
148-
149-
/*
150-
function to remove reserved keyword
151-
*/
152-
function removeReservedKeyword (string _keyword) onlyOwner public {
153-
delete(reservedKeywords[_keyword]);
154-
}
155-
156141
/* function to set reserve pricing */
157142
function setReservePricing (uint256 _reservePricing) onlyOwner public {
158143
reservePricing = _reservePricing;
@@ -182,7 +167,6 @@ contract VanityURL is Ownable,Pausable {
182167
require(checkForValidity(_vanity_url));
183168
require(vanity_address_mapping[_vanity_url] == address(0x0));
184169
require(bytes(address_vanity_mapping[msg.sender]).length == 0);
185-
require(reservedKeywords[_vanity_url] != 1);
186170
require(tokenAddress.doTransfer(msg.sender,transferTokenTo,reservePricing));
187171
vanity_address_mapping[_vanity_url] = msg.sender;
188172
address_vanity_mapping[msg.sender] = _vanity_url;
@@ -239,7 +223,6 @@ contract VanityURL is Ownable,Pausable {
239223
_vanity_url = _toLower(_vanity_url);
240224
require(checkForValidity(_vanity_url));
241225
require(vanity_address_mapping[_vanity_url] == address(0x0));
242-
require(reservedKeywords[_vanity_url] != 1);
243226
vanity_address_mapping[_vanity_url] = msg.sender;
244227
address_vanity_mapping[msg.sender] = _vanity_url;
245228
VanityReserved(msg.sender, _vanity_url);
@@ -263,7 +246,6 @@ contract VanityURL is Ownable,Pausable {
263246
function reserveVanityURLByOwner(address _to,string _vanity_url) whenNotPaused onlyOwner public {
264247
_vanity_url = _toLower(_vanity_url);
265248
require(checkForValidity(_vanity_url));
266-
require(reservedKeywords[_vanity_url] != 1);
267249
/* check if vanity url is being used by anyone */
268250
if(vanity_address_mapping[_vanity_url] != address(0x0))
269251
{

test/2_vanity.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ contract('VanityURL', function(accounts) {
1616
}).then(function(minted) {
1717
return tokenInstance.transfer(accounts[1],10);
1818
}).then(function(transfer) {
19-
// add admin as reserved keyword
20-
return vanityInstance.addReservedKeyword('admin');
21-
}).then(function(minted) {
2219
// add vanity contract to whitelist
2320
return tokenInstance.addWhiteListedContracts(vanityInstance.address);
2421
}).then(function(result) {
@@ -94,14 +91,6 @@ contract('VanityURL', function(accounts) {
9491
})
9592
});
9693

97-
it("should fail when tried to reserve reserved keywords", function() {
98-
return vanityInstance.reserve('admin').then(function(instance){
99-
assert.isUndefined(instance,"should fail when tried to reserve reserved keywords")
100-
}).catch(function(error){
101-
assert.isDefined(error,"should fail when tried to reserve reserved keywords")
102-
})
103-
});
104-
10594
it("should fail when tried to reserve non alphanumeric keywords", function() {
10695
return vanityInstance.reserve('Vi@345').then(function(instance){
10796
assert.isUndefined(instance,"should fail when tried to reserve non alphanumeric keywords")

0 commit comments

Comments
 (0)