Of course, Leone's inspiration was Akira Kurosawa's ''Yojimbo.''
Having invented the spaghetti-western a few years prior by virtually copying Akira Kurosawa’s “Yojimbo” frame by frame as “A Fistful of Dollars” to such a degree that Toho sued him, Leone used the spaghetti-western as a form to attack the, in Leone’s opinion, dominating morality of American Puritanism.
His character was based on an amoral samurai bodyguard created by Toshiro Mifune in Akira Kurosawa's Yojimbo.
Leone saw the world through movies ( A Fistful of Dollars , let us not forget, was a deliberate transposition of Kurosawa’s Yojimbo ), but at a certain point he moved beyond that purview, to a place where movies were merely the conduit to a higher level of engagement with the world at large.
Leone took his original cue from Akira Kurosawa’s Yojimbo and Sanjuro films, which starred Toshiro Mifune as a wandering ronin who looks out only for himself.
With A Fistful Of Dollars , a 1964 remake of Akira Kurosawa's Yojimbo , Leone and Eastwood introduced their iconic "Man With No Name," a drifter of few words who's heroic only by contrast to those around him, and who isn't above double-crossing those intent on cheating him anyway.