You can refer to the above quora discussion.
As far as i know, it is a common issue faced by many people. Someone is trying to take over your account. If you are continuously getting the code, I suggest you to submit a report to Whatsapp. The person who is sending this request will not be able to send it after sometime as he will be timed out due to multiple attemps. Be careful and dont share the code with ANYONE.
Take care . Don't stress on it, your account is safe until or unless you don't share the code
If you are using the privacy setting to limit your last seen and online using "My Contacts Except" option, you need to be aware there's a security issue with it.
Any new contact that you create are automatically granted access to your Last Seen and Online status on WhatsApp unless you go into this setting and include the new contact to the list. I realized it only now and more than 100 new contacts that I created after this option was enabled had access to my last seen and online status. I have now included them all to the list though.
Unless u share those codes there is no danger...
Always better not to share ur number to anyone who ask for or in social media publicly..stay away from using whatsapp for transactions...