Skip to content

Commit b6f6307

Browse files
authored
Merge pull request #28767 from ProvableHQ/fix/constructor-order
[Fix] Constructor order and documentation link.
2 parents 197b790 + 2093686 commit b6f6307

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

leo/package/src/package.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,6 @@ fn main_template(name: &str) -> String {
430430
format!(
431431
r#"// The '{name}' program.
432432
program {name}.aleo {{
433-
transition main(public a: u32, b: u32) -> u32 {{
434-
let c: u32 = a + b;
435-
return c;
436-
}}
437-
438433
// This is the constructor for the program.
439434
// The constructor allows you to manage program upgrades.
440435
// It is called when the program is deployed or upgraded.
@@ -443,9 +438,14 @@ program {name}.aleo {{
443438
// - @admin(address="aleo1...")
444439
// - @checksum(mapping="credits.aleo/fixme", key="0field")
445440
// - @custom
446-
// For more information, please refer to the documentation: <TODO>.
441+
// For more information, please refer to the documentation: `https://docs.leo-lang.org/guides/upgradability`
447442
@noupgrade
448443
async constructor() {{}}
444+
445+
transition main(public a: u32, b: u32) -> u32 {{
446+
let c: u32 = a + b;
447+
return c;
448+
}}
449449
}}
450450
"#
451451
)

0 commit comments

Comments
 (0)