I'm curious how this will work - who knows exactly how many papers they will publish at the start of a grant? And what about fields with low grant amounts (mathematics, humanities, etc?)
If I was a funding body I'd knock a few thousand off the initial grant and say "have the journal send me the bill when you publish a paper".
That way, you only have the expenditure if the research leads to published papers. If the research doesn't lead to papers, well, at least you're a few thousand better off. And of course the funding bodies would know exactly who published what when where, and they'd get the right details in the paper's acknowledgments every time.
As an alternative, if there was funding to publish only a limited number of papers that could reform the incentives that lead to "salami publication". Or perhaps it would lead to a worst-of-both-worlds where salami publication cost funding bodies a bunch of money. We shall see!