I've been struggling with this with different methods. As the most straightforward, I tried manually-flattening the code in REMIX, and verifying it on bscscan. Compiler version OK, Runs for optimization 200 OK, Optimization ON... and it always fail.
Then I tried with hardhat, and truffle, with truffle compile and verifying I got a very similar result. I think I have checked all possible options about this and I can't fix it.
I will be gratefull if any mate could give some advice.
Contract address: https://testnet.bscscan.com/token/0x64Af478C02a6Cd509EC17F11578336e8A6F3Cd5f
BSC Scan testnet output: