This is sometimes referred to as the Bodhisattva Vow of Śāntideva from the Bodhicaryāvatāra.
I have excerpted this translation by Adam Pearcey from Lotsawa House a wonderful online treasury of material.
Chapter III — Fully Adopting Bodhicitta
Joyfully I celebrate all the acts of virtue
That ease the pains of the lower realms,
And rejoice as well when those who suffer
Find themselves in states of happiness.
I rejoice in the gathering of virtue
That is the cause of awakening,
And celebrate the definite liberation
Of beings from saṃsāra’s pain.
I rejoice in the awakening of the buddhas,
And the bhūmis gained by bodhisattvas.
Gladly I rejoice in the infinite sea of virtue,
Which is the noble intention of bodhicitta,
Wishing to secure the happiness of beings,
And acting in ways that bring benefit to all.
Now I join my hands and pray
To you, the buddhas of all quarters:
Shine the lamp of Dharma upon us,
As we suffer in confusion’s darkness!
With my palms clasped at my heart,
I urge all buddhas longing for nirvāṇa:
Do not leave us blind and all alone,
But remain with us for countless ages!
Through whatever virtue I have gained
By all these actions now performed,
May the pain of every living being
Be cleared away entirely, never to return.
For all the beings ailing in the world,
Until their sickness has been healed,
May I become the doctor and the cure,
And may I nurse them back to health.
Bringing down a shower of food and drink,
May I dispel the pains of thirst and hunger,
And in those times of scarcity and famine,
May I myself appear as food and drink.
For all beings who are destitute and poor,
May I be a treasure, unending in supply,
A source of all that they might call for,
Accessible always and close by.
My own body and all that I possess,
My past, present and future virtues—
I dedicate them all, withholding nothing,
To bring about the benefit of beings.
By letting go of all I shall attain nirvāṇa,
The transcendence of misery I seek,
Since everything must finally be abandoned,
It would be best if I gave it all away.
This body of mine I have now given up,
Entirely for the pleasure of all who live.
Let them kill it, beat it and abuse it,
Forever doing with it as they please.
And if they treat it like a toy,
Or an object of ridicule and jest,
When I have given it away,
Why should I then become upset?
Let them do to me as they please,
Whatever does not harm them;
And when anyone should think of me,
May that only serve them well.
If the sight of me inspires in others
Thoughts of anger or devotion,
May such states of mind be causes
For eternally fulfilling their desires.
May those who insult me to my face,
Or cause me harm in any other way,
Even those who disparage me in secret,
Have the good fortune to awaken.
May I be a guard for those without one,
A guide for all who journey on the road,
May I become a boat, a raft or bridge,
For all who wish to cross the water.
May I be an isle for those desiring landfall,
And a lamp for those who wish for light,
May I be a bed for those who need to rest,
And a servant for all who live in need.
May I become a wishing jewel, a magic vase,
A powerful mantra and a medicine of wonder.
May I be a tree of miracles granting every wish,
And a cow of plenty sustaining all the world.
Like the earth and other great elements,
And like space itself, may I remain forever,
To support the lives of boundless beings,
By providing all that they might need.
Just so, in all the realms of beings,
As far as space itself pervades,
May I be a source of all that life requires,
Until beings pass beyond saṃsāra’s pain.
Just as the sugatas of former ages,
Aroused bodhicitta and then, in stages,
Trained themselves in skilful practice,
On the genuine path of the bodhisattvas,
Like them, I take this sacred vow:
To arouse bodhicitta here and now,
And train myself for others’ good,
Gradually, as a bodhisattva should.
Like this, all those whose minds are clear,
And who adopt bodhicitta with inspiration,
Will, to ensure that it grows thereafter,
Praise it highly in the following way:
Now my life has great significance,
At birth I found this human existence,
And now I’m born into the buddhas’ line,
As a son or daughter of the noble kind.
From this day on, come what may,
I’ll act only in an appropriate way,
And never shall I bring disgrace
Upon this flawless, noble race.
For like a beggar, poor and blind,
Who, by chance, a jewel might find,
So now, by chance, auspiciously,
In bodhi-mind is born in me.
This is the perfect nectar of immortality,
Through which the Lord of Death is overcome.
It is an inexhaustible treasury of wealth,
To dispel the poverty of all who live.
It is the very best of medicines
That heals the sickness of the world,
And the tree that shelters all who wander
Wearily along the pathways of existence.
It is the universal bridge to freedom,
Leading us all from the lower realms,
And it is a rising moon within the mind,
To cool the passions of all living beings.
It is the mighty sun whose light dispels
The darkness of ignorance in our minds.
And it is the very purest form of butter
Churned from the milk of sacred Dharma.
For beings travelling life’s pathways,
And seeking to taste its greatest joys,
This will satisfy their eternal wanderings,
By granting them the highest form of bliss.
Now with buddhas as my witness,
I invite all beings to lasting happiness,
And, before that, to ordinary joys:
May gods, asuras and others rejoice!
Translated by Adam Pearcey 2007