[examples] Add @program annotations.

This commit is contained in:
Alessandro Coglio 2022-08-05 21:59:22 -07:00
parent a178456a98
commit 47f283fb9b

View File

@ -1,4 +1,5 @@
// This function calculates the interest accrued over ten periods for some `capital` and `rate`.
@program
function fixed_period_interest(capital: u32, public rate: u32) -> u32 {
let amount: u32 = capital;
@ -11,6 +12,7 @@ function fixed_period_interest(capital: u32, public rate: u32) -> u32 {
}
// This function calculates the interest accrued over a variable number of periods (max 50) for some `capital` and `rate`.
@program
function bounded_period_interest(capital: u32, public rate: u32, periods: u8) -> u32 {
console.assert(periods <= 50u8);
let amount: u32 = capital;