This is a working script. Structure is a bit of mess, but you can still run it.
I had done more factoring in another private repo, adding encryption, if I can remove all the tokens and bad functions, I will share that one too.
Each contract actually should be a separate .py for easier randomising