8. When hiring a worker to guard a particular object, it is forbidden for the worker to accept wages paid specifically for guarding performed on Shabbos (1). If, however, the worker is hired for a week or for a month, he is entitled to collect the fee for Shabbos as part of his total fee (2).
(1) Although the act of guarding is permitted on Shabbos, the Sages created this prohibition against receiving wages, so that people wouldn't come to do business on Shabbos itself (the Sages prohibited any sort of transaction on Shabbos, out of a concern that people may inadvertently come to write something down, which is a biblical prohibition). The case here is that one agreed to pay the guard a daily rate, and thus, due to this prohibition, one does not have to pay him for the guarding he chose to do on Shabbos; consequently, the guard is not responsible for any damage to the property which occurs on Shabbos. Even if the employer wants to pay, the guard is not permitted to accept it, unless it was given in the form of a gift (See Shulchan Aruch 306:4 and the Mishna Berura there).
There is a dispute among the authorities as to whether this prohibition applies to paying someone for the performance of a mitzvah on Shabbos, for example, hiring a cantor to lead the congregation during the Shabbos prayer service (it should be noted that those who permit it, nevertheless state that one who is lenient will not see blessing come from the wages paid for Shabbos). The later authorities note that people nowadays are lenient and do hire people just for Shabbos (to perform a mitzvah), however, the Mishna Berura 306:24 states that one who wants to be stringent should not set a fee beforehand, and consequently, the money he receives later may be viewed as a gift.
(2) Hence, in that case, the guard is responsible for any damage that occurs to the property on Shabbos.