Skip to content

Commit a353b5a

Browse files
added virtual modifiers (#76)
1 parent 178d377 commit a353b5a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

contracts/tokens/SBT.sol

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ abstract contract SBT is ISBT, ERC165Upgradeable {
6060
* @param tokenId_ the token to check
6161
* @return true if `tokenId_` exists, false otherwise
6262
*/
63-
function tokenExists(uint256 tokenId_) public view override returns (bool) {
63+
function tokenExists(uint256 tokenId_) public view virtual override returns (bool) {
6464
return ownerOf(tokenId_) != address(0);
6565
}
6666

@@ -69,7 +69,7 @@ abstract contract SBT is ISBT, ERC165Upgradeable {
6969
* @param owner_ the user to get the balance of
7070
* @return the user's balance
7171
*/
72-
function balanceOf(address owner_) public view override returns (uint256) {
72+
function balanceOf(address owner_) public view virtual override returns (uint256) {
7373
return _balances[owner_].length();
7474
}
7575

@@ -79,7 +79,10 @@ abstract contract SBT is ISBT, ERC165Upgradeable {
7979
* @param index_ the id of the token in the user's array
8080
* @return the token the user owns
8181
*/
82-
function tokenOf(address owner_, uint256 index_) public view override returns (uint256) {
82+
function tokenOf(
83+
address owner_,
84+
uint256 index_
85+
) public view virtual override returns (uint256) {
8386
return _balances[owner_].at(index_);
8487
}
8588

@@ -88,7 +91,7 @@ abstract contract SBT is ISBT, ERC165Upgradeable {
8891
* @param owner_ the user to get the tokens of
8992
* @return the array of tokens the user owns
9093
*/
91-
function tokensOf(address owner_) public view override returns (uint256[] memory) {
94+
function tokensOf(address owner_) public view virtual override returns (uint256[] memory) {
9295
return _balances[owner_].values();
9396
}
9497

@@ -97,7 +100,7 @@ abstract contract SBT is ISBT, ERC165Upgradeable {
97100
* @param tokenId_ the token to get the owner of
98101
* @return address of an owner or `address(0)` if token does not exist
99102
*/
100-
function ownerOf(uint256 tokenId_) public view override returns (address) {
103+
function ownerOf(uint256 tokenId_) public view virtual override returns (address) {
101104
return _tokenOwners[tokenId_];
102105
}
103106

0 commit comments

Comments
 (0)