This is initialize
function of my upgradeable contract
contract MyContract is
Initializable,
ERC20PresetMinterPauserUpgradeable,
OwnableUpgradeable
{
function initialize(string memory _name, string memory _symbol)
public
override
initializer
{
emit ContractInitStarted(_name, _symbol, msg.sender, block.timestamp);
__ERC20PresetMinterPauser_init(_name, _symbol);
__Ownable_init_unchained();
_mint(msg.sender, 500000000 ether);
emit ContractInitEnded(_name, _symbol, msg.sender, block.timestamp);
}
}
This is 2_deploy_contracts.js
const MyContract = artifacts.require("./MyContract .sol");
const { deployProxy } = require("@openzeppelin/truffle-upgrades");
module.exports = async function (deployer) {
await deployProxy(MyContract , ["MyContract 1.0", "TenX"], { deployer, initializer: "initialize" });
};
npx truffle deploy --network rinkeby
Initialize function is never invoked. Events not triggered symbol, name, and totalSupply are empty
Perhaps, I must look into AdminUpgradeabilityProxy
But not sure
Those are contracts in etherscan:
My address:
https://rinkeby.etherscan.io/address/0x860fa46f170a87df44d7bb867aa4a5d2813127c1
Last 4 transactions for contracts:
https://rinkeby.etherscan.io/address/0x6f8dc56c88112cdaedee8610bdb5caf601c145de
AdminUpgradeabilityProxy:
https://rinkeby.etherscan.io/address/0xe97ef53dd413729425317a768a0ba425831c5107
ProxyAdmin:
https://rinkeby.etherscan.io/address/0x857411020c5e2b540fdd6c5ed0a4faeb678ef280
Implementation:
https://rinkeby.etherscan.io/address/0x2e4cd3fd7ed77a278d118b95e4bef5b7079367da
Token:
https://rinkeby.etherscan.io/token/0xe97ef53dd413729425317a768a0ba425831c5107