-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from La-DAO/quote/ERC721
latest changes
- Loading branch information
Showing
14 changed files
with
89 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | ||
import "@openzeppelin/contracts/access/Ownable.sol"; | ||
import "@openzeppelin/contracts/interfaces/IERC20.sol"; | ||
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | ||
|
||
contract XocPin is ERC721URIStorage, Ownable { | ||
using SafeERC20 for IERC20; | ||
|
||
address public constant XOCOLATL = 0xa411c9Aa00E020e4f88Bc19996d29c5B7ADB4ACf; | ||
address public constant TREASURY = 0x707C5E55277A0C2f598f191b269c9e773516052A; | ||
uint256 public constant MINT_PRICE = 100e18; | ||
|
||
uint256 public nextTokenId = 1; | ||
|
||
string public baseTokenURI; | ||
|
||
constructor(string memory _tokenURI) ERC721("XocPin", "XOCP") Ownable(TREASURY) { | ||
baseTokenURI = _tokenURI; | ||
} | ||
|
||
function mint(address to) external { | ||
IERC20(XOCOLATL).safeTransferFrom(msg.sender, TREASURY, MINT_PRICE); | ||
_mint(to, nextTokenId); | ||
nextTokenId++; | ||
} | ||
|
||
function setTokenURI(uint256 tokenId, string memory _tokenURI) external onlyOwner { | ||
_setTokenURI(tokenId, _tokenURI); | ||
} | ||
|
||
function setBaseTokenURI(string memory _baseTokenURI) external onlyOwner { | ||
baseTokenURI = _baseTokenURI; | ||
emit BatchMetadataUpdate(1, nextTokenId - 1); | ||
} | ||
|
||
function _baseURI() internal view override returns (string memory) { | ||
return baseTokenURI; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"networkName": "Polygon" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"networkName": "default_network" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[profile.default] | ||
solc = "0.8.19" | ||
solc = "0.8.20" | ||
src = 'contracts' | ||
out = 'out' | ||
libs = ['lib'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters