diff --git a/auction/program.json b/auction/program.json index eafe608..dd9f504 100644 --- a/auction/program.json +++ b/auction/program.json @@ -3,8 +3,8 @@ "version": "0.0.0", "description": "", "development": { - "private_key": "APrivateKey1zkpG9Af9z5Ha4ejVyMCqVFXRKknSm8L1ELEwcc4htk9YhVK", - "address": "aleo1yzlta2q5h8t0fqe0v6dyh9mtv4aggd53fgzr068jvplqhvqsnvzq7pj2ke" + "private_key": "APrivateKey1zkp5wvamYgK3WCAdpBQxZqQX8XnuN2u11Y6QprZTriVwZVc", + "address": "aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh" }, "license": "MIT" } diff --git a/basic_bank/src/main.leo b/basic_bank/src/main.leo index 447aca3..a458ebb 100644 --- a/basic_bank/src/main.leo +++ b/basic_bank/src/main.leo @@ -44,9 +44,7 @@ program basic_bank.aleo { // Compute the hash of the token owner. let hash: field = BHP256::hash(token.owner); - async finalize(hash, amount); - - return remaining; + return remaining then finalize (hash, amount); } // Updates on-chain state by the amount of tokens deposited. @@ -74,9 +72,7 @@ program basic_bank.aleo { amount: total, }; - async finalize(hash, amount); - - return token; + return token then finalize(hash, amount); } // Updates on-chain state by the amount of tokens withdrawn. diff --git a/battleship/program.json b/battleship/program.json index 9e34139..1b41e64 100644 --- a/battleship/program.json +++ b/battleship/program.json @@ -1,11 +1,11 @@ { - "program": "battleship.aleo", - "version": "0.0.0", - "description": "", - "development": { - "private_key": "APrivateKey1zkp86FNGdKxjgAdgQZ967bqBanjuHkAaoRe19RK24ZCGsHH", - "view_key": "AViewKey1hh6dvSEgeMdfseP4hfdbNYjX4grETwCuTbKnCftkpMwE", - "address": "aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry" - }, - "license": "MIT" - } + "program": "battleship.aleo", + "version": "0.0.0", + "description": "", + "development": { + "private_key": "APrivateKey1zkpGKaJY47BXb6knSqmT3JZnBUEGBDFAWz2nMVSsjwYpJmm", + "view_key": "AViewKey1fSyEPXxfPFVgjL6qcM9izWRGrhSHKXyN3c64BNsAjnA6", + "address": "aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy" + }, + "license": "MIT" +} diff --git a/token/src/main.leo b/token/src/main.leo index 043aca2..39d5440 100644 --- a/token/src/main.leo +++ b/token/src/main.leo @@ -18,7 +18,7 @@ program token.aleo { // The function `mint_public` issues the specified token amount for the token receiver publicly on the network. transition mint_public(public receiver: address, public amount: u64) { // Mint the tokens publicly by invoking the computation on-chain. - async finalize(receiver, amount); + return then finalize(receiver, amount); } finalize mint_public(public receiver: address, public amount: u64) { @@ -40,7 +40,7 @@ program token.aleo { /* Transfer */ transition transfer_public(public receiver: address, public amount: u64) { // Transfer the tokens publicly, by invoking the computation on-chain. - async finalize(self.caller, receiver, amount); + return then finalize(self.caller, receiver, amount); } finalize transfer_public(public sender: address, public receiver: address, public amount: u64) { @@ -94,11 +94,9 @@ program token.aleo { amount: difference, }; - // Increment the token amount publicly for the token receiver. - async finalize(receiver, amount); - // Output the sender's change record. - return remaining; + // Increment the token amount publicly for the token receiver. + return remaining then finalize(receiver, amount); } finalize transfer_private_to_public(public receiver: address, public amount: u64) { @@ -118,11 +116,9 @@ program token.aleo { amount: amount, }; - // Decrement the token amount of the caller publicly. - async finalize(self.caller, amount); - // Output the receiver's record. - return transferred; + // Decrement the token amount of the caller publicly. + return transferred then finalize(self.caller, amount); } finalize transfer_public_to_private(public sender: address, public amount: u64) { diff --git a/vote/src/main.leo b/vote/src/main.leo index 7628a1d..6e9032a 100644 --- a/vote/src/main.leo +++ b/vote/src/main.leo @@ -40,16 +40,14 @@ program vote.aleo { // Generate a new proposal id. let id: field = BHP256::hash(info.title); - // Finalize the proposal id. - async finalize(id); - // Return a new record for the proposal. + // Finalize the proposal id. return Proposal { owner: self.caller, gates: 0u64, id, info, - }; + } then finalize(id); } // Create a new proposal in the "tickets" mapping. finalize propose(public id: field) { @@ -62,13 +60,11 @@ program vote.aleo { public voter: address, ) -> Ticket { // Finalize the proposal id for the ticket. - async finalize(pid); - return Ticket { owner: voter, gates: 0u64, pid, - }; + } then finalize(pid); } // Create a new ticket on a proposal in the "tickets" mapping. finalize new_ticket(public pid: field) { @@ -78,7 +74,7 @@ program vote.aleo { // Vote privately to agree with a proposal. transition agree(ticket: Ticket) { // Finalize this vote. - async finalize(ticket.pid); + return then finalize(ticket.pid); } finalize agree(public pid: field) { // Publicly increment the number of agree votes. @@ -88,7 +84,7 @@ program vote.aleo { // Vote privately to disagree with a proposal. transition disagree(ticket: Ticket) { // Finalize this vote. - async finalize(ticket.pid); + return then finalize(ticket.pid); } finalize disagree(pid: field) { // Publicly increment the number of disagree votes.