Skip to content

Commit

Permalink
change isAvailable() function logic
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcabot committed Oct 20, 2022
1 parent bd7a2dd commit 636b33f
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/SoulName.sol
Expand Up @@ -126,7 +126,7 @@ contract SoulName is NFT, ISoulName {
uint256 yearsPeriod,
string memory _tokenURI
) public override returns (uint256) {
require(!isAvailable(name), "NAME_ALREADY_EXISTS");
require(isAvailable(name), "NAME_ALREADY_EXISTS");
require(bytes(name).length > 0, "ZERO_LENGTH_NAME");
require(yearsPeriod > 0, "ZERO_YEARS_PERIOD");
require(
Expand Down Expand Up @@ -280,9 +280,9 @@ contract SoulName is NFT, ISoulName {
string memory lowercaseName = Utils.toLowerCase(name);
if (nameData[lowercaseName].exists) {
uint256 tokenId = nameData[lowercaseName].tokenId;
return tokenData[tokenId].expirationDate >= block.timestamp;
return tokenData[tokenId].expirationDate < block.timestamp;
} else {
return false;
return true;
}
}

Expand Down
79 changes: 79 additions & 0 deletions docs/elin/contracts/access/Ownable.md
@@ -0,0 +1,79 @@
# Ownable







*Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. By default, the owner account will be the one that deploys the contract. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.*

## Methods

### owner

```solidity
function owner() external view returns (address)
```



*Returns the address of the current owner.*


#### Returns

| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```



*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*


### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```



*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name | Type | Description |
|---|---|---|
| newOwner | address | undefined |



## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```





#### Parameters

| Name | Type | Description |
|---|---|---|
| previousOwner `indexed` | address | undefined |
| newOwner `indexed` | address | undefined |



0 comments on commit 636b33f

Please sign in to comment.