Here you can see the source code of the wallet v4: https://github.com/ton-blockchain/wallet-contract, wallet v3: https://github.com/ton-blockchain/ton/blob/master/crypto/smartcont/wallet-v3-code.fif
P.S. great article with explanations of each version of wallet contract: https://ton.org/docs/participate/wallets/contracts