I read it about a relationship of two men, where one praised the other extensively for solely his own benefit.
The question requests a verb: "the act of..."
The verb is "flatter". Example:
Joe flattered his boss constantly so as to win the coveted promotion.
The noun expressing the act of flattering is "flattery", as in
Flattery will get you nowhere.
In the above sentence the speaker is saying that he/she is immune to flattery.
By the way, in my experience almost no one is immune to flattery. Try flattering your boss, your date, or your banker when applying for credit; you'll be pleased with the results.
Someone who is a self-serving flatterer is a sycophant
A sycophant is a person who tries to win favor from wealthy or influential people by flattering them. Also known as brown-nosers, teacher's pets or suck-ups.
noun. a person who tries to please someone in order to gain a personal advantage