leo/tests/compiler/records/init_expression.leo
2022-06-27 16:59:06 -10:00

28 lines
455 B
Plaintext

/*
namespace: Compile
expectation: Pass
*/
record Token {
// The token owner.
owner: address,
// The Aleo balance (in gates).
balance: u64,
// The token amount.
amount: u64,
}
function mint(r0: address, r1: u64) -> Token {
return Token {
owner: r0,
balance: 0u64,
amount: r1,
};
}
function main(x: address) -> u64 {
const c: u64 = 1u64;
let t: Token = mint(x, c);
return t.balance;
}