Skip to content

Commit 566e4a0

Browse files
David Adamyanhideto13
authored andcommitted
feat: delete ownerMint setBaseURI functions #MRN1183
1 parent c34417f commit 566e4a0

File tree

2 files changed

+0
-96
lines changed

2 files changed

+0
-96
lines changed

contracts/MetarunLaunch.sol

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ contract MetarunLaunch is Ownable, ReentrancyGuard {
1818
using ECDSA for bytes32;
1919

2020
error CannotIncreaseMaxMintableSupply();
21-
error CannotUpdatePermanentBaseURI();
2221
error CosignerNotSet();
2322
error GlobalWalletLimitOverflow();
2423
error InsufficientStageTimeGap();
@@ -61,17 +60,12 @@ contract MetarunLaunch is Ownable, ReentrancyGuard {
6160
event SetMaxMintableSupply(uint256 maxMintableSupply);
6261
event SetGlobalWalletLimit(uint256 globalWalletLimit);
6362
event SetActiveStage(uint256 activeStage);
64-
event SetBaseURI(string baseURI);
6563
event SetTimestampExpirySeconds(uint64 expiry);
66-
event PermanentBaseURI(string baseURI);
6764
event Withdraw(uint256 value);
6865

6966
// Whether this contract is mintable.
7067
bool private _mintable;
7168

72-
// Whether base URI is permanent. Once set, base URI is immutable.
73-
bool private _baseURIPermanent;
74-
7569
// Specify how long a signature from cosigner is valid for, recommend 300 seconds.
7670
uint64 private _timestampExpirySeconds;
7771

@@ -84,9 +78,6 @@ contract MetarunLaunch is Ownable, ReentrancyGuard {
8478
// Global wallet limit, across all stages.
8579
uint256 private _globalWalletLimit;
8680

87-
// Current base URI.
88-
string private _currentBaseURI;
89-
9081
// ERC1155 token of the collection on sale
9182
MetarunCollection private _collection;
9283

@@ -489,20 +480,6 @@ contract MetarunLaunch is Ownable, ReentrancyGuard {
489480
totalMinted += qtyMinted;
490481
}
491482

492-
/**
493-
* @dev Mints token(s) by owner.
494-
*
495-
* NOTE: This function bypasses validations thus only available for owner.
496-
* This is typically used for owner to pre-mint or mint the remaining of the supply.
497-
*/
498-
function ownerMint(uint32 qty, address to)
499-
external
500-
onlyOwner
501-
hasSupply(qty)
502-
{
503-
//_safeMint(to, qty);
504-
}
505-
506483
/**
507484
* @dev Withdraws funds by owner.
508485
*/
@@ -513,24 +490,6 @@ contract MetarunLaunch is Ownable, ReentrancyGuard {
513490
emit Withdraw(value);
514491
}
515492

516-
/**
517-
* @dev Sets token base URI.
518-
*/
519-
function setBaseURI(string calldata baseURI) external onlyOwner {
520-
if (_baseURIPermanent) revert CannotUpdatePermanentBaseURI();
521-
_currentBaseURI = baseURI;
522-
emit SetBaseURI(baseURI);
523-
}
524-
525-
/**
526-
* @dev Sets token base URI permanent. Cannot revert.
527-
*/
528-
function setBaseURIPermanent() external onlyOwner {
529-
_baseURIPermanent = true;
530-
emit PermanentBaseURI(_currentBaseURI);
531-
}
532-
533-
534493
/**
535494
* @dev Returns data hash for the given minter, qty and timestamp.
536495
*/

test/MetarunLaunch.test.ts

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,61 +1289,6 @@ describe('MetarunLaunch', function () {
12891289
await expect(mint).to.be.revertedWith('InvalidProof');
12901290
});
12911291

1292-
it('mints by owner', async () => {
1293-
await contract.setStages([
1294-
{
1295-
price: ethers.utils.parseEther('0.5'),
1296-
walletLimit: 1,
1297-
merkleRoot: ethers.utils.hexZeroPad('0x1', 32),
1298-
maxStageSupply: 1,
1299-
startTimeUnixSeconds: 0,
1300-
endTimeUnixSeconds: 1,
1301-
},
1302-
]);
1303-
await contract.setMintable(true);
1304-
1305-
const [owner, address1] = await ethers.getSigners();
1306-
1307-
await contract.ownerMint(5, owner.address);
1308-
1309-
const [, walletMintedCount, stagedMintedCount] =
1310-
await contract.getStageInfo(0);
1311-
expect(walletMintedCount).to.equal(0);
1312-
expect(stagedMintedCount.toNumber()).to.equal(0);
1313-
// todo: need to check resulting balance of ERC1155
1314-
// const ownerBalance = await contract.balanceOf(owner.address);
1315-
// expect(ownerBalance.toNumber()).to.equal(5);
1316-
1317-
await contract.ownerMint(5, address1.address);
1318-
const [, address1Minted] = await readonlyContract.getStageInfo(0, {
1319-
from: address1.address,
1320-
});
1321-
expect(address1Minted).to.equal(0);
1322-
1323-
// todo: need to check resulting balance of ERC1155
1324-
// const address1Balance = await contract.balanceOf(address1.address);
1325-
// expect(address1Balance.toNumber()).to.equal(5);
1326-
expect((await contract.totalMinted()).toNumber()).to.equal(10);
1327-
});
1328-
1329-
it('mints by owner - invalid cases', async () => {
1330-
await contract.setStages([
1331-
{
1332-
price: ethers.utils.parseEther('0.5'),
1333-
walletLimit: 1,
1334-
merkleRoot: ethers.utils.hexZeroPad('0x1', 32),
1335-
maxStageSupply: 1,
1336-
startTimeUnixSeconds: 0,
1337-
endTimeUnixSeconds: 1,
1338-
},
1339-
]);
1340-
await contract.setMintable(true);
1341-
await expect(
1342-
contract.ownerMint(1001, readonly.address),
1343-
).to.be.revertedWith('NoSupplyLeft');
1344-
});
1345-
});
1346-
13471292
describe('Global wallet limit', function () {
13481293
it('validates global wallet limit in constructor', async () => {
13491294
const Launch = await ethers.getContractFactory('MetarunLaunch');

0 commit comments

Comments
 (0)