Skip to content

Commit

Permalink
evm: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nhynes committed Mar 23, 2024
1 parent 8e92dcd commit 68ff2b7
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions evm/src/NFTrout.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,9 @@ contract NFTrout is
}

/// Returns a cost for the payer to breed the trout that is no larger than the list price.
function getBreedingFee(address breeder, TokenId tokenId) public view returns (uint256) {
function getBreedingFee(address breeder, TokenId tokenId) public view returns (uint256 fee) {
if (_isApprovedOrOwner(breeder, tokenId)) return 0;
uint256 fee = studFees[tokenId];
if (fee == 0) revert Unauthorized();
return fee;
if ((fee = studFees[tokenId]) == 0) revert Unauthorized();
}

function tokenURI(uint256 tokenId)
Expand Down Expand Up @@ -257,7 +255,7 @@ contract NFTrout is
if (task.kind == TaskKind.Burn) {
BurnTask memory burnTask = abi.decode(task.payload, (BurnTask));
for (uint256 j; j < burnTask.tokens.length; j++) {
if (!_exists(burnTask.tokens[j])) continue;
if (!_exists(TokenId.unwrap(burnTask.tokens[j]))) continue;
_burn(TokenId.unwrap(burnTask.tokens[j]));
}
return;
Expand Down Expand Up @@ -291,10 +289,6 @@ contract NFTrout is
return whom == owner || getApproved(tokenId) == whom || isApprovedForAll(owner, whom);
}

function _exists(TokenId id) internal view returns (bool) {
return _exists(TokenId.unwrap(id));
}

function _startTokenId() internal pure override returns (uint256) {
return 1;
}
Expand Down

0 comments on commit 68ff2b7

Please sign in to comment.