Skip to content

Commit

Permalink
Add test & remove withdraw fund feature
Browse files Browse the repository at this point in the history
  • Loading branch information
lpopo0856 committed Jul 17, 2023
1 parent e220d1b commit bd4be38
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
5 changes: 0 additions & 5 deletions contracts/FeralfileArtworkV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -607,11 +607,6 @@ contract FeralfileExhibitionV4 is
);
}

/// @notice withdraw all fund
function withdrawFunds() external onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}

/// @notice Event emitted when new Artwork has been minted
event NewArtwork(
address indexed owner,
Expand Down
26 changes: 26 additions & 0 deletions test/feralfile_exhibition_v4.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,32 @@ contract("FeralfileExhibitionV4_0", async (accounts) => {
assert.equal(seriesTotalSupply1, 0);
});

it("test duplicate series in constructor", async function () {
// Deploy contract with duplicate series defined
let seriesIds = [0, 1, 2, 3, 1];
let seriesMaxSupply = [1, 1, 100, 1000, 10000];
try {
await FeralfileExhibitionV4.new(
"Feral File V4 Test",
"FFv4",
true,
true,
this.signer,
this.vault.address,
COST_RECEIVER,
CONTRACT_URI,
seriesIds,
seriesMaxSupply
);
} catch (error) {
assert.ok(
error.message.includes(
"FeralfileExhibitionV4: duplicate seriesId"
)
);
}
})

it("test mint artwork", async function () {
const contract = this.contracts[0];

Expand Down

0 comments on commit bd4be38

Please sign in to comment.