How to use MultiSend for deploying the contracts

hi all.

I would love to use safe-smart-account/contracts/libraries/MultiSend.sol at main · safe-global/safe-smart-account · GitHub

Basically, I want to deploy 3 separate contracts, but they all have to happen in the same tx. I’d love to call multiSend function which would deploy 3 bytecodes that I’d pass to multiSend.

The problem I realized in the contract is, how do I get the result addresses for each contract deployed ? the code of multiSend rewrites the return value in the loop - transaction 1’s result overwrites transaction 0’s result.

Hope I made sense of this. Any thoughts ?