Skip to content

Commit

Permalink
fix auction example
Browse files Browse the repository at this point in the history
  • Loading branch information
collinc97 committed Jul 19, 2023
1 parent 0a8e493 commit 8cffd6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
19 changes: 9 additions & 10 deletions examples/auction/build/main.aleo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ program auction.aleo;

record Bid:
owner as address.private;
gates as u64.private;
bidder as address.private;
amount as u64.private;
is_winner as boolean.private;
Expand All @@ -12,25 +11,25 @@ function place_bid:
input r0 as address.private;
input r1 as u64.private;
assert.eq self.caller r0;
cast aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh 0u64 r0 r1 false into r2 as Bid.record;
cast aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh r0 r1 false into r2 as Bid.record;
output r2 as Bid.record;


function resolve:
input r0 as Bid.record;
input r1 as Bid.record;
assert.eq self.caller aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh;
gte r0.amount r1.amount into r2;
ternary r2 r0.owner r1.owner into r3;
ternary r2 r0.gates r1.gates into r4;
ternary r2 r0.bidder r1.bidder into r5;
ternary r2 r0.amount r1.amount into r6;
ternary r2 r0.is_winner r1.is_winner into r7;
cast r3 r4 r5 r6 r7 into r8 as Bid.record;
output r8 as Bid.record;
ternary r2 r0.bidder r1.bidder into r4;
ternary r2 r0.amount r1.amount into r5;
ternary r2 r0.is_winner r1.is_winner into r6;
cast r3 r4 r5 r6 into r7 as Bid.record;
output r7 as Bid.record;


function finish:
input r0 as Bid.record;
assert.eq self.caller aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh;
cast r0.bidder r0.gates r0.bidder r0.amount true into r1 as Bid.record;
cast r0.bidder r0.bidder r0.amount true into r1 as Bid.record;
output r1 as Bid.record;

4 changes: 0 additions & 4 deletions examples/auction/build/program.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@
"program": "auction.aleo",
"version": "0.0.0",
"description": "",
"development": {
"private_key": "APrivateKey1zkpG9Af9z5Ha4ejVyMCqVFXRKknSm8L1ELEwcc4htk9YhVK",
"address": "aleo1yzlta2q5h8t0fqe0v6dyh9mtv4aggd53fgzr068jvplqhvqsnvzq7pj2ke"
},
"license": "MIT"
}
2 changes: 1 addition & 1 deletion examples/auction/inputs/auction.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ second: Bid = Bid {
bidder: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
amount: 90u64,
is_winner: false,
_nonce: 1635474322959998727812727786860193861506102794050195384593971440884677453921group,
_nonce: 1511010328912449299156978046557700301564153667442988008615502964863620401388group,
};

[finish]
Expand Down

0 comments on commit 8cffd6b

Please sign in to comment.