-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
US Treasury Auction Example #12
Conversation
|
||
// Complete an auction and emit results | ||
// Anyone can call this, as the creator sets the duration | ||
// question: can/should it emit all bids for public verification? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not matter if you emit the bids, they are in the confidential store so they are not public. Normally, the pattern is to use the onchain callback to return the leak data of the bid that you want to expose.
|
||
func main() { | ||
fr := framework.New() | ||
fr.DeployContract("TAuction.sol/TAuction.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand the example to also send the transactions?
uint256 currentTotal = totalData.length > 0 ? abi.decode(totalData, (uint256)) : 0; | ||
uint256 newTotal = currentTotal + amount; | ||
Suave.confidentialStore(bid.id, "tauction:v0:noncompetitivetotal", abi.encode(newTotal)); | ||
emit BidSubmitted(auctionId, bid.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current iteration, events cannot be emitted off-chain
} | ||
|
||
Auction[] public auctions; | ||
mapping(uint256 => Suave.BidId[]) private _bids; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used?
This PR adds an example of how to run US Treasury Auctions on SUAVE.
There are still some parts of the contract to fix, and the main.go script to write once that has happened.