I would like to write the following logic in the migration script for my truffle project with upgradeable contracts:
if(contract is not yet deployed) {
const mynewcontract = deployProxy(MyContract, {deployer});
} else {
const myupgradedcontract = upgradeProxy(MyContract, {deployer});
}
How can I handle that or how can I check in the migration script if the contract has already been deployed?