I've tried all ways but my contract owner address is always 0x0.
I would need to set the Contract Owner to use the features of the ERC721 presets for minting.
contract ERC721v1 is Initializable, OwnableUpgradeable, ERC721PresetMinterPauserAutoIdUpgradeable {
uint256 public secretNumber;
uint256 public secretNumberTwo;
address private _admin;
function initialize() public initializer {
OwnableUpgradeable.__Ownable_init();
__ERC721PresetMinterPauserAutoId_init('name', 'symbol', 'ipfs://abc');
}
}
Here is my deployment script
const { deployProxy } = require('@openzeppelin/truffle-upgrades');
const ERC721v1 = artifacts.require('ERC721v1');
module.exports = async function (deployer) {
const instance = await deployProxy(ERC721v1, { deployer, initializer: 'initialize' });
console.log('Deployed', instance.address);
};
Environment
Using solidity ^0.8.0
Compile with Truffle