0

Say if I have a token like safemoon. Is there a way to add in a function to turn off token transaction burn fee once x-amount of tokens are in circulation?

I’m newer to solidity, and I want to be sure I’m going in the right direction, but as of now I have no leads for implementing this function.

1 Answer 1

0

Well to make it simple;

You would need a point in time to stop the mint.

It could be anything, let's take a look at the supply.

You have a function that returns the total supply. You have a function that burn tokens.

Here is a minimalist example where the burn function would return and not execute the burn is a target limit is reached.

uint256 threshold;  // max supply target

function burn(uint256 amount) public {
 if(totalSupply() >= threshold){
  return;
 }

  // burn here
}
1
  • Thank you. So I would not need to create a new variable in this sense for tokens burned? Something like what you described above should suffice for turning off the burn fee? I just want to make sure I’m fully understanding it before I deploy to testnet to try it out.
    – Chris J
    Commented Sep 29, 2021 at 16:37

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.