Skip to content

Commit

Permalink
contracts: add override and remove immutable (#255)
Browse files Browse the repository at this point in the history
Co-authored-by: ian <ian@maicoin.com>
  • Loading branch information
tn606024 and ian authored Apr 28, 2022
1 parent 0f88c36 commit 996771f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contracts/ERC721A.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contract ERC721A is Context, ERC165, IERC721A {
/**
* @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
*/
function totalSupply() public view returns (uint256) {
function totalSupply() public view override returns (uint256) {
// Counter underflow is impossible as _burnCounter cannot be incremented
// more than _currentIndex - _startTokenId() times
unchecked {
Expand Down
2 changes: 1 addition & 1 deletion contracts/extensions/ERC721ABurnable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract contract ERC721ABurnable is ERC721A, IERC721ABurnable {
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
function burn(uint256 tokenId) public virtual override {
_burn(tokenId, true);
}
}
8 changes: 4 additions & 4 deletions contracts/extensions/ERC721AQueryable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
* - `startTimestamp` = `<Timestamp of start of ownership>`
* - `burned = `false`
*/
function explicitOwnershipOf(uint256 tokenId) public view returns (TokenOwnership memory) {
function explicitOwnershipOf(uint256 tokenId) public view override returns (TokenOwnership memory) {
TokenOwnership memory ownership;
if (tokenId < _startTokenId() || tokenId >= _currentIndex) {
return ownership;
Expand All @@ -45,7 +45,7 @@ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
* @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
* See {ERC721AQueryable-explicitOwnershipOf}
*/
function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory) {
function explicitOwnershipsOf(uint256[] memory tokenIds) external view override returns (TokenOwnership[] memory) {
unchecked {
uint256 tokenIdsLength = tokenIds.length;
TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
Expand All @@ -72,7 +72,7 @@ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
address owner,
uint256 start,
uint256 stop
) external view returns (uint256[] memory) {
) external view override returns (uint256[] memory) {
unchecked {
if (start >= stop) revert InvalidQueryRange();
uint256 tokenIdsIdx;
Expand Down Expand Up @@ -139,7 +139,7 @@ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
* multiple smaller scans if the collection is large enough to cause
* an out-of-gas error (10K pfp collections should be fine).
*/
function tokensOfOwner(address owner) external view returns (uint256[] memory) {
function tokensOfOwner(address owner) external view override returns (uint256[] memory) {
unchecked {
uint256 tokenIdsIdx;
address currOwnershipAddr;
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/StartTokenIdHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pragma solidity ^0.8.4;
* to be returned by the overriden `_startTokenId()` function of ERC721A in the ERC721AStartTokenId mocks.
*/
contract StartTokenIdHelper {
uint256 public immutable startTokenId;
uint256 public startTokenId;

constructor(uint256 startTokenId_) {
startTokenId = startTokenId_;
Expand Down

0 comments on commit 996771f

Please sign in to comment.