diff --git a/contracts/FeralfileArtworkV4.sol b/contracts/FeralfileArtworkV4.sol index ac2ca5e..1b02797 100644 --- a/contracts/FeralfileArtworkV4.sol +++ b/contracts/FeralfileArtworkV4.sol @@ -79,9 +79,9 @@ contract FeralfileExhibitionV4 is constructor( string memory name_, string memory symbol_, - address signer_, bool burnable_, bool bridgeable_, + address signer_, address vault_, address costReceiver_, string memory tokenBaseURI_, @@ -195,7 +195,7 @@ contract FeralfileExhibitionV4 is } /// @notice Set vault contract - /// @dev don't allow to set signer as zero address + /// @dev don't allow to set vault as zero address function setVault(address vault_) external onlyOwner { require( vault_ != address(0), @@ -217,13 +217,13 @@ contract FeralfileExhibitionV4 is ); } - /// @notice Start token selling + /// @notice Start token sale function startSale() external onlyOwner { mintable = false; resumeSale(); } - /// @notice Resume token selling + /// @notice Resume token sale function resumeSale() public onlyOwner { require( !mintable, @@ -251,7 +251,7 @@ contract FeralfileExhibitionV4 is _selling = false; } - /// @notice Stop token selling and burn remaining tokens + /// @notice Stop token sale and burn remaining tokens function stopSaleAndBurn() external onlyOwner { pauseSale(); @@ -288,7 +288,7 @@ contract FeralfileExhibitionV4 is for (uint16 j = 0; j < seriesIds.length; j++) { if (artwork.seriesId == seriesIds[j]) { address to = recipientAddresses[j]; - _transfer(from, to, tokenId); + _safeTransfer(from, to, tokenId, ""); break; } } @@ -373,12 +373,20 @@ contract FeralfileExhibitionV4 is /// @notice Update the base URI for all tokens function setTokenBaseURI(string memory baseURI_) external onlyOwner { + require( + bytes(tokenBaseURI).length > 0, + "ERC721Metadata: baseURI_ is empty" + ); tokenBaseURI = baseURI_; } /// @notice the cost receiver address /// @param costReceiver_ - the address of cost receiver function setCostReceiver(address costReceiver_) external onlyOwner { + require( + costReceiver_ != address(0), + "FeralfileExhibitionV4: costReceiver_ is zero address" + ); costReceiver = costReceiver_; } diff --git a/migrations/301_feralfile_exhibition_v4_0.js b/migrations/301_feralfile_exhibition_v4_0.js index d205395..160edac 100644 --- a/migrations/301_feralfile_exhibition_v4_0.js +++ b/migrations/301_feralfile_exhibition_v4_0.js @@ -1,21 +1,19 @@ -var FeralfileExhibitionV4 = artifacts.require('FeralfileExhibitionV4'); +var FeralfileExhibitionV4 = artifacts.require("FeralfileExhibitionV4"); -const argv = require('minimist')(process.argv.slice(2), { - string: ['exhibition_curator'], +const argv = require("minimist")(process.argv.slice(2), { + string: ["exhibition_curator"], }); module.exports = function (deployer) { - let exhibition_name = argv.exhibition_name || 'FFV4 Test'; - let exhibition_symbol = argv.exhibition_symbol || 'FeralfileExhibitionV4'; + let exhibition_name = argv.exhibition_name || "FFV4 Test"; + let exhibition_symbol = argv.exhibition_symbol || "FeralfileExhibitionV4"; let exhibition_signer = - argv.exhibition_signer || - '0x6732389c6d47d01487dcDc96e2Cc6BAf108452f2'; + argv.exhibition_signer || "0x6732389c6d47d01487dcDc96e2Cc6BAf108452f2"; let exhibition_vault = - argv.exhibition_vault || - '0x0c51e8becb17ba3203cd04d3fc31fcb90de412a1'; + argv.exhibition_vault || "0x0c51e8becb17ba3203cd04d3fc31fcb90de412a1"; let exhibition_cost_receiver = argv.exhibition_cost_receiver || - '0x6732389c6d47d01487dcDc96e2Cc6BAf108452f2'; + "0x6732389c6d47d01487dcDc96e2Cc6BAf108452f2"; let burnable = argv.burnable || true; let bridgeable = argv.bridgeable || true; @@ -23,14 +21,14 @@ module.exports = function (deployer) { FeralfileExhibitionV4, exhibition_name, exhibition_symbol, - exhibition_signer, burnable, bridgeable, + exhibition_signer, exhibition_vault, exhibition_cost_receiver, - 'https://ipfs.bitmark.com/ipfs/QmaQegRqExfFx8zuR6yscxzUwQJUc96LuNNQiAMK9BsUQe', - 'https://ipfs.bitmark.com/ipfs/QmaQegRqExfFx8zuR6yscxzUwQJUc96LuNNQiAMK9BsUQe', + "https://ipfs.bitmark.com/ipfs/QmaQegRqExfFx8zuR6yscxzUwQJUc96LuNNQiAMK9BsUQe", + "https://ipfs.bitmark.com/ipfs/QmaQegRqExfFx8zuR6yscxzUwQJUc96LuNNQiAMK9BsUQe", [1, 2, 3, 4], - [1000, 1000, 1000, 1000], + [1000, 1000, 1000, 1000] ); }; diff --git a/test/feralfile_exhibition_v4.js b/test/feralfile_exhibition_v4.js index 54d54db..55e1523 100644 --- a/test/feralfile_exhibition_v4.js +++ b/test/feralfile_exhibition_v4.js @@ -20,9 +20,9 @@ contract("FeralfileExhibitionV4_0", async (accounts) => { let contract = await FeralfileExhibitionV4.new( "Feral File V4 Test", "FFv4", - this.signer, true, true, + this.signer, this.vault.address, COST_RECEIVER, TOKEN_BASE_URI,