Skip to content

Commit

Permalink
wip: mock McGoblinBurger functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Anish-Agnihotri committed Jun 3, 2022
1 parent 9dcbcd0 commit 5e056bd
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/MockBurger.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

/// ============ Interfaces ============

interface ExtendedERC721 {
/// @notice Checks owner of NFT
/// @param tokenId to check
/// @return owner address
function ownerOf(uint256 tokenId) external view returns (address owner);
}

/// @title MockBurger
/// @notice Mocks hypothetical functionality of a McGoblinBurger contract
contract MockBurger {
// ============ Immutable storage ===========

/// @dev goblintown NFT contract
ExtendedERC721 public immutable GOBLIN_TOWN;

// ============ Constructor ============

/// @notice Creates a new MockBurger contract
/// @param _GOBLIN_TOWN contract
constructor(address _GOBLIN_TOWN) {
GOBLIN_TOWN = ExtendedERC721(_GOBLIN_TOWN);
}

/// @notice Arbitrary claim function
function claim(uint256[] memory tokenIds) external {
for (uint256 i = 0; i < tokenIds.length; i++) {
// Require ownership of gobbler
require(GOBLIN_TOWN.ownerOf(tokenIds[i]) == msg.sender, "oNlY foR GOblEn");
// Mint new Mockburger NFT
}
}
}

0 comments on commit 5e056bd

Please sign in to comment.