Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 0 additions & 160 deletions auction/build/abi.json

This file was deleted.

134 changes: 134 additions & 0 deletions auction/build/auction/abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"program": "auction.aleo",
"structs": [],
"records": [
{
"path": [
"Bid"
],
"fields": [
{
"name": "owner",
"ty": {
"Primitive": "Address"
},
"mode": "Private"
},
{
"name": "bidder",
"ty": {
"Primitive": "Address"
},
"mode": "Private"
},
{
"name": "amount",
"ty": {
"Primitive": {
"UInt": "U64"
}
},
"mode": "Private"
},
{
"name": "is_winner",
"ty": {
"Primitive": "Boolean"
},
"mode": "Private"
}
]
}
],
"mappings": [],
"storage_variables": [],
"functions": [
{
"name": "place_bid",
"inputs": [
{
"Plaintext": {
"ty": {
"Primitive": "Address"
},
"mode": "Private"
}
},
{
"Plaintext": {
"ty": {
"Primitive": {
"UInt": "U64"
}
},
"mode": "Private"
}
}
],
"outputs": [
{
"Record": {
"path": [
"Bid"
],
"program": "auction.aleo"
}
}
]
},
{
"name": "resolve",
"inputs": [
{
"Record": {
"path": [
"Bid"
],
"program": "auction.aleo"
}
},
{
"Record": {
"path": [
"Bid"
],
"program": "auction.aleo"
}
}
],
"outputs": [
{
"Record": {
"path": [
"Bid"
],
"program": "auction.aleo"
}
}
]
},
{
"name": "finish",
"inputs": [
{
"Record": {
"path": [
"Bid"
],
"program": "auction.aleo"
}
}
],
"outputs": [
{
"Record": {
"path": [
"Bid"
],
"program": "auction.aleo"
}
}
]
}
]
}
File renamed without changes.
9 changes: 0 additions & 9 deletions auction/build/program.json

This file was deleted.

1 change: 0 additions & 1 deletion auction/leo.lock

This file was deleted.

6 changes: 3 additions & 3 deletions auction/src/main.leo
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ program auction.aleo {
// The address of the auction runner is aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg.
fn place_bid(bidder: address, amount: u64) -> Bid {
// Ensure the caller is the auction bidder.
assert_eq(self.caller, bidder);
assert_eq(std::ctx::caller(), bidder);
// Return a new 'Bid' record for the auction bidder.
return Bid {
owner: aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg,
Expand All @@ -38,7 +38,7 @@ program auction.aleo {
// In the event of a tie, the first bid is selected.
fn resolve(first: Bid, second: Bid) -> Bid {
// Ensure the caller is the auctioneer.
assert_eq(self.caller, aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg);
assert_eq(std::ctx::caller(), aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg);
// Resolve the winner of the auction.
if (first.amount >= second.amount) {
return first;
Expand All @@ -53,7 +53,7 @@ program auction.aleo {
// Assumes that the function is invoked only after all bids have been resolved.
fn finish(bid: Bid) -> Bid {
// Ensure the caller is the auctioneer.
assert_eq(self.caller, aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg);
assert_eq(std::ctx::caller(), aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg);
// Return 'is_winner' as 'true' in the winning 'Bid'.
return Bid {
owner: bid.bidder,
Expand Down
Loading