Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【LocalNouns】仕上げ #159

Open
wants to merge 149 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
7a20fbe
Erc721 ap2 p (#3)
EibaKatsu Nov 1, 2023
cd290c3
開発者ロイヤリティを設定
EibaKatsu Nov 1, 2023
b14463f
ミント価格修正
EibaKatsu Nov 1, 2023
e370912
P2PTradableの手数料設定
EibaKatsu Nov 1, 2023
10b0bbd
_sendRoyaltyで共通化
EibaKatsu Nov 1, 2023
4b3f9d5
typo修正
EibaKatsu Nov 1, 2023
e86427e
asset最新化
EibaKatsu Nov 1, 2023
567ca7a
トレード先アドレスを限定(contract sizeエラーになったのでリファクタリングも)
EibaKatsu Nov 1, 2023
2c1e33f
全部の都道府県を作成できるかチェック
EibaKatsu Nov 1, 2023
2605975
tokenGateのdeploy追加
EibaKatsu Nov 2, 2023
73c86a4
Background追加
EibaKatsu Nov 6, 2023
c0d4dec
最適化パラメタ追加
EibaKatsu Nov 24, 2023
ac6fc01
setApprovalForAll制御
EibaKatsu Nov 24, 2023
d2abc36
都道府県ランダムロジック変更
EibaKatsu Nov 24, 2023
69cae73
デプロイ後setup
EibaKatsu Nov 24, 2023
c86f600
都道府県ランダムロジック変更
EibaKatsu Nov 24, 2023
015a1a2
tokenGate追加
EibaKatsu Nov 24, 2023
3113c93
リエントランシー対策
EibaKatsu Nov 25, 2023
e0b1cd0
エラー回避のためkeccak256使用を回避
EibaKatsu Nov 29, 2023
ecc3e95
ロイヤリティ設定を可変に
EibaKatsu Nov 29, 2023
a19ef51
ロイヤリティ設定
EibaKatsu Nov 29, 2023
55aad6c
gasMultiplier設定
EibaKatsu Nov 30, 2023
34e55d2
mumbaiガス優先度設定変更
EibaKatsu Dec 14, 2023
809473b
NounsSeeder廃止、Randomizerを使用
EibaKatsu Dec 14, 2023
c9b13ab
トランザクションハッシュログ追加
EibaKatsu Dec 14, 2023
b192c51
コメント追加
EibaKatsu Dec 14, 2023
6ae00ff
都道府県ヘッド(ver2)のテスト用デプロイ
EibaKatsu Dec 14, 2023
7ad9a59
パーツ最新化
EibaKatsu Dec 14, 2023
703a1c6
パーツ最新化
EibaKatsu Dec 14, 2023
f8a09da
コントラクト最新デプロイ
EibaKatsu Dec 14, 2023
e93aaa1
Merge branch 'P2P_Royalty' of https://github.com/EibaKatsu/generative…
EibaKatsu Dec 14, 2023
d26db1a
Event追加、Approve制限修正
EibaKatsu Dec 23, 2023
ecc252b
HEADが1種類しか出現しない県があったので順番変更
EibaKatsu Dec 23, 2023
7052e62
author変更
EibaKatsu Dec 23, 2023
fb60a05
trait-name 修正
EibaKatsu Dec 23, 2023
0c98af3
minterのデプロイ追加
EibaKatsu Dec 23, 2023
f4cb242
Piementクレカ払い対応のためミント先アドレス指定を追加
EibaKatsu Jan 17, 2024
51b38cd
メインネットデプロイ
EibaKatsu Jan 17, 2024
7303893
アドレス更新
EibaKatsu Jan 19, 2024
e04bc12
add font view
isamu May 13, 2023
1d5ecac
add font components
isamu May 13, 2023
b364a7e
fix type and required
isamu May 13, 2023
86fad98
deploy NotoSans font
Takuya-Mizutani May 12, 2023
f0d2809
update @openzeppelin/contracts
isamu May 15, 2023
c31a374
update font address
isamu May 14, 2023
0ac9891
format
isamu May 14, 2023
29988ca
update package
isamu May 15, 2023
81befbc
update package
isamu May 15, 2023
747c526
update packages
isamu May 15, 2023
ad117cc
LocalNouns initial working version
EibaKatsu Jun 15, 2023
313e436
add font checker
Takuya-Mizutani May 15, 2023
42fe171
fixing preview
Takuya-Mizutani May 15, 2023
7395729
font preview
Takuya-Mizutani May 22, 2023
d0b565c
NounsDescriptorV1デプロイ用
EibaKatsu Aug 5, 2023
e61cb01
write to address file
EibaKatsu Aug 5, 2023
0f06cc0
不要なコメント削除
EibaKatsu Aug 9, 2023
0325add
set contract address to external file
EibaKatsu Aug 9, 2023
d3e4ec6
add underscore
EibaKatsu Aug 9, 2023
350e98d
format
EibaKatsu Aug 10, 2023
97e7f11
set prefecture name to Trait
EibaKatsu Aug 10, 2023
234898d
Correct typos
EibaKatsu Aug 10, 2023
a30e9b8
commitie,developper,desighnerを削除
EibaKatsu Aug 12, 2023
aeb569c
minter追加
EibaKatsu Aug 13, 2023
32fe142
verifyコマンドのaddress指定修正
EibaKatsu Aug 13, 2023
de72d6a
Minterコントラクト追加
EibaKatsu Aug 15, 2023
7cd9333
ProviderTokenA1のmintを無効にするためのmint関数を追加
EibaKatsu Aug 17, 2023
949311e
localhostのアドレス自動読込を追加
EibaKatsu Aug 17, 2023
8343e34
Minter経由だとmsg.senderがMinterになるため、_toを指定
EibaKatsu Aug 17, 2023
5e9566e
自動テスト追加
EibaKatsu Aug 21, 2023
0ba8567
画像データ修正(末尾にオブジェクトタイプを追加)
EibaKatsu Aug 21, 2023
fd7b94a
バッチミント追加
EibaKatsu Aug 21, 2023
ec3e024
head,accessoryの名前をtraitsに設定
EibaKatsu Aug 22, 2023
118652e
mintをpopulateから分離
EibaKatsu Aug 22, 2023
b8c2c32
head始まり(都道府県)は1期対象から除外
EibaKatsu Aug 22, 2023
46bc22c
head partsIdの3桁目以上をバージョンとして扱う対応
EibaKatsu Aug 22, 2023
be0abd1
都道府県地図のheadをバージョン1で登録
EibaKatsu Aug 22, 2023
6bb63f0
都道府県地図のheadをバージョン1で登録
EibaKatsu Aug 22, 2023
600f289
都道府県をランダムに決定する機能を追加
EibaKatsu Aug 23, 2023
fedd0ba
都道府県ランダム指定時のバージョン考慮不足のバグfix
EibaKatsu Aug 23, 2023
1524e5f
ミント関数の配列パラメタの要素数チェックを追加
EibaKatsu Aug 23, 2023
8b2bd50
変数名変更 amount -> counter
EibaKatsu Aug 23, 2023
6517783
remove Opensea's DefaultOperatorFilterer, add
EibaKatsu Aug 24, 2023
d97d2a4
ERC721AP2PTradable追加
EibaKatsu Aug 27, 2023
ac38e48
remove old description
EibaKatsu Aug 27, 2023
53b1e2d
LocalNounsの継承先をERC721AP2PTradableに変更
EibaKatsu Aug 27, 2023
b0a6719
correct author
EibaKatsu Aug 27, 2023
5ee4258
P2Pトレード追加
EibaKatsu Aug 28, 2023
dfd48e7
add comment
EibaKatsu Aug 29, 2023
9b01fab
mintSelectedPrefectureに数量指定追加
EibaKatsu Oct 24, 2023
3e2472e
mintSelectedPrefectureBatchの削除
EibaKatsu Oct 24, 2023
45347a9
mintSelectedPrefectureBatch削除
EibaKatsu Oct 25, 2023
e660d94
tokenGate追加
EibaKatsu Oct 25, 2023
73172d8
whitelistをpublicに変更
EibaKatsu Oct 25, 2023
6664fcd
tokenGateによるチェック追加
EibaKatsu Oct 25, 2023
c4e83c4
tokenGate追加
EibaKatsu Oct 25, 2023
9a0f2cf
*_localhost.ts追加
EibaKatsu Oct 25, 2023
99b3548
Send ETH チェック追加
EibaKatsu Oct 25, 2023
e494a57
_nextTokenIdは_safeMintで更新されるので indexを追加
EibaKatsu Oct 25, 2023
eb33972
都道府県ごとのミント数mintNumberPerPrefectureを追加
EibaKatsu Oct 25, 2023
d808505
コメント修正
EibaKatsu Oct 26, 2023
0490555
都道府県番号のチェック追加
EibaKatsu Oct 26, 2023
3712ded
継承元のmintPrice, mintLimitは使用しない
EibaKatsu Oct 26, 2023
d086ec9
コメント追加
EibaKatsu Oct 26, 2023
8f48318
ミント数上限のチェック
EibaKatsu Oct 26, 2023
403929b
ownerMint追加
EibaKatsu Oct 27, 2023
bb88bb9
都道府県ランダムミントの割合を設定
EibaKatsu Nov 1, 2023
800b2ca
determinePrefectureIdのテストコード追加
EibaKatsu Nov 1, 2023
ddbad2e
不要コード削除
EibaKatsu Nov 1, 2023
a0282e0
開発者ロイヤリティを設定
EibaKatsu Nov 1, 2023
7fde374
ミント価格修正
EibaKatsu Nov 1, 2023
a48e3af
P2PTradableの手数料設定
EibaKatsu Nov 1, 2023
88ddb55
_sendRoyaltyで共通化
EibaKatsu Nov 1, 2023
00b09d5
typo修正
EibaKatsu Nov 1, 2023
71543a7
asset最新化
EibaKatsu Nov 1, 2023
c47dad6
トレード先アドレスを限定(contract sizeエラーになったのでリファクタリングも)
EibaKatsu Nov 1, 2023
fe246ee
全部の都道府県を作成できるかチェック
EibaKatsu Nov 1, 2023
01137b5
tokenGateのdeploy追加
EibaKatsu Nov 2, 2023
ad3ddec
Background追加
EibaKatsu Nov 6, 2023
389acce
最適化パラメタ追加
EibaKatsu Nov 24, 2023
52c56f0
setApprovalForAll制御
EibaKatsu Nov 24, 2023
daf7366
都道府県ランダムロジック変更
EibaKatsu Nov 24, 2023
8f1c449
デプロイ後setup
EibaKatsu Nov 24, 2023
5d6fb1c
都道府県ランダムロジック変更
EibaKatsu Nov 24, 2023
648af17
tokenGate追加
EibaKatsu Nov 24, 2023
5d59d88
リエントランシー対策
EibaKatsu Nov 25, 2023
6548ac5
エラー回避のためkeccak256使用を回避
EibaKatsu Nov 29, 2023
f9f9d52
ロイヤリティ設定を可変に
EibaKatsu Nov 29, 2023
4a8c72f
ロイヤリティ設定
EibaKatsu Nov 29, 2023
2ed0ded
gasMultiplier設定
EibaKatsu Nov 30, 2023
b66d628
mumbaiガス優先度設定変更
EibaKatsu Dec 14, 2023
ff24014
NounsSeeder廃止、Randomizerを使用
EibaKatsu Dec 14, 2023
1ff4da3
トランザクションハッシュログ追加
EibaKatsu Dec 14, 2023
e240fd9
コメント追加
EibaKatsu Dec 14, 2023
0e0cc8b
都道府県ヘッド(ver2)のテスト用デプロイ
EibaKatsu Dec 14, 2023
9c4bd2f
パーツ最新化
EibaKatsu Dec 14, 2023
ea67a29
コントラクト最新デプロイ
EibaKatsu Dec 14, 2023
48c6382
Event追加、Approve制限修正
EibaKatsu Dec 23, 2023
1c7aa09
HEADが1種類しか出現しない県があったので順番変更
EibaKatsu Dec 23, 2023
7d5a89e
author変更
EibaKatsu Dec 23, 2023
3a72d60
trait-name 修正
EibaKatsu Dec 23, 2023
af13517
minterのデプロイ追加
EibaKatsu Dec 23, 2023
bfd240f
Piementクレカ払い対応のためミント先アドレス指定を追加
EibaKatsu Jan 17, 2024
b292349
メインネットデプロイ
EibaKatsu Jan 17, 2024
b8cf4d5
アドレス更新
EibaKatsu Jan 19, 2024
513ba7d
Merge branch 'main' of https://github.com/EibaKatsu/generative into P…
EibaKatsu Jan 19, 2024
f3481ca
Minter設定変更
EibaKatsu Mar 9, 2024
ea8ee55
トレードへリスト
EibaKatsu Mar 9, 2024
8d682a2
エアドロップ
EibaKatsu Mar 9, 2024
15dfc7e
Merge branch 'P2P_Royalty' of https://github.com/EibaKatsu/generative…
EibaKatsu Mar 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 117 additions & 30 deletions contract/contracts/LocalNounsToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,38 @@ contract LocalNounsToken is ProviderTokenA2, ILocalNounsToken {
IAssetProviderExMint public assetProvider2;
address public minter;
mapping(uint256 => uint256[]) public tradePrefecture; // トレード先指定の都道府県
mapping(uint256 => address) public tradeAddress; // トレード先指定のアドレス

address public administratorsAddress; // 運営ウォレット
address[] public royaltyAddresses; // ロイヤリティ送信先ウォレット
mapping(address => uint256) public royaltyRatio; // ロイヤリティ送信先ウォレットごとの割合
uint256 royaltyRatioTotal; // royaltyRatioの合計(割戻用)
bool public canSetApproval = false; // setApprovalForAll, approveの可否

uint256 public tradeRoyalty = 0.003 ether; // P2Pトレードのロイヤリティ
uint256 public salesRoyaltyBasisPoint = 1000; // P2Pセールのロイヤリティ、購入価格の10%

mapping(address => bool) public approveWhiteList; // Approveを許可するアドレスリスト

constructor(
IAssetProviderExMint _assetProvider,
address _minter
) ProviderTokenA2(_assetProvider, 'Local Nouns', 'Local Nouns') {
description = 'Local Nouns Token.';
description = 'Local Nouns';
assetProvider2 = _assetProvider;
// mintPrice = 1e13; // 0.001 ※ mintPriceは Minterコントラクトで制御するため使用しない
// mintLimit = 5000; ※ mintLimitは Minterコントラクトで制御するため使用しない
minter = _minter;
administratorsAddress = msg.sender;

// ロイヤリティ送信先(コンストラクタではデプロイアドレス100%)
royaltyAddresses = [msg.sender];
royaltyRatio[msg.sender] = 1;
royaltyRatioTotal = 1;
}

function tokenName(uint256 _tokenId) internal pure override returns (string memory) {
return string(abi.encodePacked('Local Nouns ', _tokenId.toString()));
}

function tokenURI(uint256 _tokenId) public view override returns (string memory) {
require(_tokenId < _nextTokenId(), 'LocalNounsToken.tokenURI: nonexistent token');
require(_tokenId < _nextTokenId(), 'nonexistent token');

(string memory svgPart, string memory tag) = assetProvider2.generateSVGPart(_tokenId);
bytes memory image = bytes(svgPart);
Expand Down Expand Up @@ -77,21 +88,25 @@ contract LocalNounsToken is ProviderTokenA2, ILocalNounsToken {
uint256 _prefectureId,
uint256 _amount
) public virtual returns (uint256 tokenId) {
require(msg.sender == minter || msg.sender == owner(), 'Sender is not minter nor owner');
require(msg.sender == minter || msg.sender == owner(), 'Invalid sender');
require(_prefectureId % 100 <= 47, 'Invalid prefectureId');

// リエントランシー対策のため状態変更を先に実施
_safeMint(_to, _amount);

uint256 startTokenId = _nextTokenId() - _amount;

for (uint256 i = 0; i < _amount; i++) {
assetProvider2.mint(_prefectureId, _nextTokenId() + i);
assetProvider2.mint(_prefectureId, startTokenId + i);
}
_safeMint(_to, _amount);
return _nextTokenId() - 1;
}

function ownerMint(
address[] memory _to,
uint256[] memory _prefectureId,
uint256[] memory _amount
) public onlyOwner returns (uint256 tokenId) {
) external onlyOwner returns (uint256 tokenId) {
// 引数の整合性チェック
require(_to.length == _prefectureId.length && _to.length == _amount.length, 'Invalid Arrays length');

Expand All @@ -101,31 +116,51 @@ contract LocalNounsToken is ProviderTokenA2, ILocalNounsToken {
return _nextTokenId() - 1;
}

function mint() public payable override returns (uint256 tokenId) {
revert('Cannot use this function');
function mint() public payable override returns (uint256) {
revert('Cannot use');
}

function setMinter(address _minter) public onlyOwner {
function setMinter(address _minter) external onlyOwner {
minter = _minter;
}

function setAdministratorsAddress(address _admin) external onlyOwner {
administratorsAddress = _admin;
function setCanSetAproval(bool _canSetApproval) external onlyOwner {
canSetApproval = _canSetApproval;
}

function setApproveWhiteList(address _address, bool approve) external onlyOwner {
approveWhiteList[_address] = approve;
}

function setRoyaltyAddresses(address[] memory _addr, uint256[] memory ratio) external onlyOwner {
// 引数の整合性チェック
require(_addr.length == ratio.length, 'Invalid Arrays length');
royaltyAddresses = _addr;
royaltyRatioTotal = 0;

for (uint256 i = 0; i < _addr.length; i++) {
royaltyRatio[_addr[i]] = ratio[i];
royaltyRatioTotal += ratio[i];
}
}

/**
* @param _tokenId the token id for put on the trade list.
* @param _prefectures prefectures that you want to trade. if you don't want specific prefecture, you don't need to set.
* @param _tradeAddress the address only who can trade.
*/
function putTradeLocalNoun(uint256 _tokenId, uint256[] memory _prefectures) public {
function putTradeLocalNoun(uint256 _tokenId, uint256[] memory _prefectures, address _tradeAddress) public {
for (uint256 i = 0; i < _prefectures.length; i++) {
require(_prefectures[i] > 0 && _prefectures[i] <= 47, 'incorrect prefecutre id');
}

super.putTrade(_tokenId, true);
tradePrefecture[_tokenId] = _prefectures;
if (_tradeAddress != address(0)) {
tradeAddress[_tokenId] = _tradeAddress;
}

emit PutTradePrefecture(_tokenId, _prefectures);
emit PutTradePrefecture(_tokenId, _prefectures, _tradeAddress);
}

function getTradePrefectureFor(uint256 _tokenId) public view returns (uint256[] memory) {
Expand All @@ -137,11 +172,20 @@ contract LocalNounsToken is ProviderTokenA2, ILocalNounsToken {

uint256[] memory emptyArray;
tradePrefecture[_tokenId] = emptyArray;
tradeAddress[_tokenId] = address(0);

emit CancelTradePrefecture(_tokenId);
}

function executeTradeLocalNoun(uint256 _myTokenId, uint256 _targetTokenId) public {
function executeTradeLocalNoun(uint256 _myTokenId, uint256 _targetTokenId) public payable {
require(msg.value >= tradeRoyalty, 'Insufficial royalty');

// tradeAddressがある場合はmsg.senderをチェック
require(
tradeAddress[_targetTokenId] == address(0) || msg.sender == tradeAddress[_targetTokenId],
'Limited address can trade'
);

// tradePrefectureがない場合は、希望都道府県がないためチェック不要
if (tradePrefecture[_targetTokenId].length > 0) {
uint256 myTokenIdPrefecture = assetProvider2.getPrefectureId(_myTokenId);
Expand All @@ -156,38 +200,81 @@ contract LocalNounsToken is ProviderTokenA2, ILocalNounsToken {
}

super.executeTrade(_myTokenId, _targetTokenId);
_processTradeRoyalty(msg.value);
emit ExecuteTrade(_targetTokenId, ownerOf(_targetTokenId), _myTokenId, ownerOf(_myTokenId));
}

function putTrade(uint256 _tokenId, bool _isOnTrade) public override {
revert('Cannot use this function');
function putTrade(uint256, bool) public pure override {
revert('Cannot use');
}

function executeTrade(uint256 _myTokenId, uint256 _targetTokenId) public override {
revert('Cannot use this function');
function executeTrade(uint256, uint256) public pure override {
revert('Cannot use');
}

function purchase(uint256 _tokenId, address _buyer, address _facilitator) external payable override {
super._purchase(_tokenId, _buyer, _facilitator);
emit Purchase(_tokenId, _buyer);
}

// transfer時はトレード解除
function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal override {
uint256[] memory emptyArray;
tradePrefecture[startTokenId] = emptyArray;
tradeAddress[startTokenId] = address(0);
super._beforeTokenTransfers(from, to, startTokenId, quantity);
}

function setTradeRoyalty(uint256 _royalty) external onlyOwner {
tradeRoyalty = _royalty;
}

function setSalesRoyaltyBasisPoint(uint256 _bp) external onlyOwner {
salesRoyaltyBasisPoint = _bp;
}

// pay royalties to admin here
function _processRoyalty(uint _salesPrice, uint _tokenId) internal override returns (uint256 royalty) {
royalty = (_salesPrice * 50) / 1000; // 5.0%
address payable payableTo = payable(administratorsAddress);
payableTo.transfer(royalty);
function _processRoyalty(uint _salesPrice, uint) internal override returns (uint256 royalty) {
// royalty = (_salesPrice * 100) / 1000; // 10.0%
royalty = (_salesPrice * salesRoyaltyBasisPoint) / 10000;
_sendRoyalty(royalty);
}

// pay royalties to admin here
function _processTradeRoyalty(uint _royalty) internal {
_sendRoyalty(_royalty);
}

// send royalties to admin and developper
function _sendRoyalty(uint _royalty) internal {
for (uint256 i = 0; i < royaltyAddresses.length; i++) {
_trySendRoyalty(royaltyAddresses[i], (_royalty * royaltyRatio[royaltyAddresses[i]]) / royaltyRatioTotal);
}
}

function _trySendRoyalty(address to, uint amount) internal {
(bool sent, ) = payable(to).call{ value: amount }('');
require(sent, 'Failed to send');
}

function withdraw() external payable onlyOwner {
require(administratorsAddress != address(0), "administratorsAddress shouldn't be 0");
(bool sent, ) = payable(administratorsAddress).call{ value: address(this).balance }('');
require(sent, 'failed to move fund to administratorsAddress contract');
_sendRoyalty(address(this).balance);
}

// iLocalNounsTokenでERC721のtotalSupplyを使用したいけど、二重継承でエラーになるので個別関数を準備
// 二重継承でエラーになるので個別関数を準備
function totalSupply2() public view returns (uint256) {
return super.totalSupply();
}

// 誰もがトークンを承認できないようにする
function setApprovalForAll(address operator, bool approved) public override {
require(canSetApproval || approveWhiteList[operator], 'Not allowed to set approval for all');
super.setApprovalForAll(operator, approved);
}

// 特定のトークンの承認も不可能にする
function approve(address to, uint256 tokenId) public payable override {
require(canSetApproval || approveWhiteList[to], 'Not allowed to approve');
super.approve(to, tokenId);
}
}
15 changes: 10 additions & 5 deletions contract/contracts/localNouns/LocalNounsMinter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ import './interfaces/ILocalNounsToken.sol';
import '../interfaces/ITokenGate.sol';

contract LocalNounsMinter is Ownable {
// Fires when the purchase executed
event MintSelectedPrefecture(uint256 prefectureId, uint256 amount, address minter);

ILocalNounsToken public token;
ITokenGate public immutable tokenGate;

uint256 public mintPriceForSpecified = 0.003 ether;
uint256 public mintPriceForNotSpecified = 0.001 ether;
uint256 public mintPriceForSpecified = 0.03 ether;
uint256 public mintPriceForNotSpecified = 0.01 ether;

uint256 public mintMax = 1500;

Expand Down Expand Up @@ -82,14 +85,16 @@ contract LocalNounsMinter is Ownable {
require(token.totalSupply2() + _amount <= mintMax, 'Over the mint limit');

uint256 mintPrice;
if(_prefectureId == 0){
if (_prefectureId == 0) {
mintPrice = mintPriceForNotSpecified;
}else{
} else {
mintPrice = mintPriceForSpecified;
}
require(msg.value >= mintPrice * _amount, 'Must send the mint price');

return token.mintSelectedPrefecture(msg.sender, _prefectureId, _amount);
tokenId = token.mintSelectedPrefecture(msg.sender, _prefectureId, _amount);

emit MintSelectedPrefecture(_prefectureId, _amount, msg.sender);
}

function withdraw() external payable onlyOwner {
Expand Down
Loading