Pre-heat the oven to 160C fan-forced (350F) and line three 12-hole mini muffin tins with liners.
In a large bowl, whisk together the sugar and oil.
Add the eggs one-at-a-time and whisk them through.
Stir in the sifted dry ingredients.
Fold through the grated carrot and walnuts.
Divide the batter between the cupcake liners.
Bake for 20-30 minutes or until a cake tester inserted in the middle of the cupcakes comes out clean.
Transfer to a wire rack to cool.
To make the icing, beat the butter and cream cheese until soft then add the icing sugar and vanilla and beat until light and fluffy (beat in colour if using).
If the icing is too thick, add a little water and if too thin, add a little extra icing sugar.
Pipe the icing onto the cooled cupcakes.