1

I'd like to know if it makes sense to have an upgradeable smart contract. My contract has a burn implemented in it, and down the line I would like to modify the burn percentage to 0% once the token reaches x-amount in circulating supply. Is this reason enough to import the Openzeppelin libraries below? Or no?

import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

1 Answer 1

1

I would say no. And simply importing the libraries is not enough - you have to implement the upgradability properly, if you want it to work.

The kind of logic you described can be easily integrated in the contract code, right from the beginning. Just add some conditions to the burn functionality. So why not implement it from the very start.

In my opinion you should only consider upgradability if you expect the logic to change in ways which you can't anticipate currently. And even then I would be very careful - using upgradability adds complexity and reduces user trust in the contract(s).

1
  • Thanks. My contract is similar to safemoons, except I added in a function to have fees sent to a charity wallet. What would be the best way to modify the burn, so that it turns off once supply is at "x-amount of coins"?
    – Chris J
    Commented Sep 27, 2021 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.