crypto-bug-hunters / bug-buster

🪲 Bug Buster, a bug bounty platform powered by Cartesi Rollups
https://x.com/BugBusterApp
Apache License 2.0
10 stars 10 forks source link

Allow embedding bounties into the base image #72

Closed guidanoli closed 4 months ago

guidanoli commented 5 months ago

We have to find a way to add bounties before spinning up the machine. This is necessary for large bounties that would be too expensive or too large to add via inputs. One example is the Solidity bounty.

Between all the fields of the AppBounty struct, the InputIndex field would have to be made optional because it would not be added via an input. This would indicate to the consumer of the state (in our case, the web front-end), that the bounty was built into the base image.

In the back-end, we'd also have to modularize the code that adds a bounty from the Advance function, so that we can call it in the main function before calling rollmelette.Run. The CodeZipBinary parameter would have to be serialized to some file like builtin-bouties.json.

fmoura commented 5 months ago

This could be done in a more "manual" way. We just have to embed the Bounty files inside the machine, and have the bounties itself being added through inputs, like the "ordinary" ones, but with a special field or value on the "file" field, that indicates it have to search the file inside the machine. This way there is no need to modify the front end nor the Application State.

It will have the costs of adding an input, but not the limit on the bounty file

guidanoli commented 5 months ago

This solution may work for a few built-in bounties, but it may get costly (and annoying) to add built-in bounties one-by-one.