Need help creating functions enable-disable trading

Hi, I need help creating a function to be able to enable / disable trading and be able to activate the enable trading function after deploy contract by only modified by onlyOwner from the write option unable on the bsc already deploy contract.

To prevent bots trading even when I add LP until launched of the contract for everyone.

Anyone can help with that? Thanks in advance!

example after deploy contract to write

set

if you're using openzeppelin, you can make your contract inherit Pausable.sol then you should be able to pause, unpause transactions. if you want to know how to write such functions, refer to this: https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20Pausable

2 Likes

Thanks, I'll have a look, It will work on BSC too?

yes. it should work on BSC. Just give it a try on the testnet :grinning_face_with_smiling_eyes:

2 Likes