Skip to content

Commit

Permalink
Rename "Bugless" as "Bug Buster"
Browse files Browse the repository at this point in the history
  • Loading branch information
guidanoli committed May 21, 2024
1 parent aa0f3c4 commit 23199fd
Show file tree
Hide file tree
Showing 26 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ bounties:
$(MAKE) -C tests/bounties

test-image:
docker build --tag bugless-test-image --file tests/Dockerfile --progress plain .
docker build --tag bug-buster-test-image --file tests/Dockerfile --progress plain .

test:
docker run -v $(shell pwd):/mnt --rm -it bugless-test-image lua5.4 tests/tests.lua
docker run -v $(shell pwd):/mnt --rm -it bug-buster-test-image lua5.4 tests/tests.lua

run:
cartesi run
Expand Down
4 changes: 2 additions & 2 deletions bug-less.drawio
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<mxCell id="6vjLHSTCWr16vqxmGMeG-2" value="Hacker" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" parent="1" vertex="1">
<mxGeometry x="80" y="280" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="6vjLHSTCWr16vqxmGMeG-7" value="Bugless" style="whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxCell id="6vjLHSTCWr16vqxmGMeG-7" value="Bug Buster" style="whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="270" y="190" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="6vjLHSTCWr16vqxmGMeG-32" value="&lt;div&gt;# code/start.sh&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;lua start.lua&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;# code/start.lua&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;_G.os = nil&lt;/div&gt;&lt;div&gt;input = io.read()&lt;/div&gt;&lt;div&gt;exec(input)&lt;br&gt;&lt;/div&gt;" style="whiteSpace=wrap;html=1;aspect=fixed;align=left;fontFamily=Courier New;" parent="1" vertex="1">
Expand Down Expand Up @@ -95,7 +95,7 @@
<mxPoint x="28" y="-10" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="6vjLHSTCWr16vqxmGMeG-71" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;text-decoration:underline;&quot;&gt;&lt;b&gt;Bugless State&lt;br&gt;&lt;/b&gt;&lt;/p&gt;&lt;hr&gt;&amp;nbsp;" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;whiteSpace=wrap;" parent="1" vertex="1">
<mxCell id="6vjLHSTCWr16vqxmGMeG-71" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;text-decoration:underline;&quot;&gt;&lt;b&gt;Bug Buster State&lt;br&gt;&lt;/b&gt;&lt;/p&gt;&lt;hr&gt;&amp;nbsp;" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;whiteSpace=wrap;" parent="1" vertex="1">
<mxGeometry x="40" y="520" width="160" height="110" as="geometry" />
</mxCell>
<mxCell id="hhckV3p7YOsD2mqn5yDh-1" value="Atores" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=30;" vertex="1" parent="1">
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/bounty.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"bugless/shared"
"bug-buster/shared"
"encoding/base64"
"io"
"log"
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/exploit.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"bugless/shared"
"bug-buster/shared"

"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

var rootCmd = &cobra.Command{
Use: "bugless-cli",
Short: "Command-line tool for the BugLess DApp",
Use: "bug-buster-cli",
Short: "Command-line tool for the Bug Buster App",
}

func Execute() {
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/send.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"bugless/shared"
"bug-buster/shared"
"context"
"encoding/json"
"log"
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/sponsor.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"bugless/shared"
"bug-buster/shared"
"log"
"math/big"

Expand Down
8 changes: 4 additions & 4 deletions cli/cmd/state.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"bugless/shared"
"bug-buster/shared"
"context"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -32,7 +32,7 @@ func stateRun(cmd *cobra.Command, args []string) {

state := findLastState(inputs)
if state == nil {
state = new(shared.BugLessState)
state = new(shared.BugBusterState)
state.Bounties = make([]*shared.AppBounty, 0)
}

Expand All @@ -43,7 +43,7 @@ func stateRun(cmd *cobra.Command, args []string) {
fmt.Println(string(stateJson))
}

func findLastState(inputs []readerclient.Input) *shared.BugLessState {
func findLastState(inputs []readerclient.Input) *shared.BugBusterState {
for i := len(inputs) - 1; i >= 0; i-- {
if len(inputs[i].Reports) == 0 {
continue
Expand All @@ -60,7 +60,7 @@ func findLastState(inputs []readerclient.Input) *shared.BugLessState {
log.Fatal(err)
}

var state shared.BugLessState
var state shared.BugBusterState
err = json.Unmarshal(payload, &state)

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"bugless/shared"
"bug-buster/shared"
"context"
"encoding/json"
"log"
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/withdraw.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"bugless/shared"
"bug-buster/shared"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "bugless/cli/cmd"
import "bug-buster/cli/cmd"

func main() {
cmd.Execute()
Expand Down
12 changes: 6 additions & 6 deletions contract/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"bugless/shared"
"bug-buster/shared"
"context"
"encoding/base64"
"encoding/json"
Expand All @@ -15,11 +15,11 @@ import (
"github.com/rollmelette/rollmelette"
)

type BugLessContract struct {
state shared.BugLessState
type BugBusterContract struct {
state shared.BugBusterState
}

func (c *BugLessContract) Advance(
func (c *BugBusterContract) Advance(
env rollmelette.Env,
metadata rollmelette.Metadata,
deposit rollmelette.Deposit,
Expand Down Expand Up @@ -260,7 +260,7 @@ func (c *BugLessContract) Advance(
return nil
}

func (c *BugLessContract) Inspect(env rollmelette.EnvInspector, payload []byte) error {
func (c *BugBusterContract) Inspect(env rollmelette.EnvInspector, payload []byte) error {
var input shared.TestExploit
err := json.Unmarshal(payload, &input)
if err != nil {
Expand Down Expand Up @@ -358,7 +358,7 @@ func RunExploit(env rollmelette.EnvInspector, bountyIndex int, exploit string, c
func main() {
ctx := context.Background()
opts := rollmelette.NewRunOpts()
app := new(BugLessContract)
app := new(BugBusterContract)
err := rollmelette.Run(ctx, opts, app)
if err != nil {
slog.Error("application error", "error", err)
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "bugless",
"name": "bug-buster",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/bounty/[bountyId]/exploit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { FileWithPath } from "@mantine/dropzone";

import { useWaitForTransaction } from "wagmi";
import { SendExploit } from "../../../../model/inputs";
import { usePrepareSendExploit } from "../../../../hooks/bugless";
import { usePrepareSendExploit } from "../../../../hooks/bug-buster";
import { useInputBoxAddInput } from "../../../../hooks/contracts";

import { BountyParams, InvalidBountyId } from "../utils.tsx";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/bounty/[bountyId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { formatEther } from "viem";

import { GetBounty } from "../../../model/reader";
import { Exploit, getBountyTotalPrize, AppBounty } from "../../../model/state";
import { usePrepareWithdrawSponsorship } from "../../../hooks/bugless";
import { usePrepareWithdrawSponsorship } from "../../../hooks/bug-buster";
import { useInputBoxAddInput } from "../../../hooks/contracts";

import { BountyParams, InvalidBountyId } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/bounty/[bountyId]/sponsor/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { FC, useState } from "react";
import { parseEther } from "viem";
import { AddSponsorship } from "../../../../model/inputs";
import { usePrepareAddSponsorship } from "../../../../hooks/bugless";
import { usePrepareAddSponsorship } from "../../../../hooks/bug-buster";
import { useEtherPortalDepositEther } from "../../../../hooks/contracts";
import { useWaitForTransaction } from "wagmi";

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/bounty/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { FileWithPath } from "@mantine/dropzone";
import { useInputBoxAddInput } from "../../../hooks/contracts";
import { useWaitForTransaction } from "wagmi";
import { CreateAppBounty } from "../../../model/inputs";
import { usePrepareCreateBounty } from "../../../hooks/bugless";
import { usePrepareCreateBounty } from "../../../hooks/bug-buster";
import { FileDrop } from "../../../components/filedrop";
import { useBlockTimestamp } from "../../../hooks/block";

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const Header: FC = () => {
<Group h="100%" px={20}>
<Center>
<Anchor href="/" underline="never">
<Title>🪲 Bugless</Title>
<Title>🪲 Bug Buster</Title>
</Anchor>
</Center>
<Group justify="flex-end" style={{ flex: 1 }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function encodeInput(input: Input): Hex {
return toHex(new TextEncoder().encode(JSON.stringify(input)));
}

function usePrepareBuglessInput(input: Input) {
function usePrepareBugBusterInput(input: Input) {
const { config } = usePrepareInputBoxAddInput({
args: [getDAppAddress(), encodeInput(input)],
enabled: true,
Expand All @@ -25,7 +25,7 @@ function usePrepareBuglessInput(input: Input) {
return config;
}

function usePrepareBuglessETHDeposit(input: Input, valueInWei: bigint) {
function usePrepareBugBusterETHDeposit(input: Input, valueInWei: bigint) {
const { config } = usePrepareEtherPortalDepositEther({
args: [getDAppAddress(), encodeInput(input)],
value: valueInWei,
Expand All @@ -36,27 +36,27 @@ function usePrepareBuglessETHDeposit(input: Input, valueInWei: bigint) {
}

export function usePrepareCreateBounty(bounty: CreateAppBounty) {
return usePrepareBuglessInput({ kind: "CreateAppBounty", payload: bounty });
return usePrepareBugBusterInput({ kind: "CreateAppBounty", payload: bounty });
}

export function usePrepareAddSponsorship(
sponsorship: AddSponsorship,
value: bigint,
) {
return usePrepareBuglessETHDeposit(
return usePrepareBugBusterETHDeposit(
{ kind: "AddSponsorship", payload: sponsorship },
value,
);
}

export function usePrepareSendExploit(exploit: SendExploit) {
return usePrepareBuglessInput({ kind: "SendExploit", payload: exploit });
return usePrepareBugBusterInput({ kind: "SendExploit", payload: exploit });
}

export function usePrepareWithdrawSponsorship(
withdrawSponsorship: WithdrawSponsorship,
) {
return usePrepareBuglessInput({
return usePrepareBugBusterInput({
kind: "WithdrawSponsorship",
payload: withdrawSponsorship,
});
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/model/reader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from "@apollo/client";
import { gql } from "./__generated__/gql";
import { CompletionStatus } from "./__generated__/graphql";
import { BugLessState, AppBounty, Voucher } from "./state";
import { BugBusterState, AppBounty, Voucher } from "./state";
import { TaggedInput, SendExploit } from "./inputs";

type ReaderLoadingResult = {
Expand Down Expand Up @@ -82,7 +82,7 @@ const GET_VOUCHERS = gql(/* GraphQL */ `
`);

// Get the latest bug less state from the GraphQL API polling the API every 500 ms.
function GetLatestState(): ReaderResult<BugLessState> {
function GetLatestState(): ReaderResult<BugBusterState> {
const { data, loading, error } = useQuery(GET_LAST_REPORTS, {
pollInterval: 500, // ms
});
Expand All @@ -97,7 +97,7 @@ function GetLatestState(): ReaderResult<BugLessState> {
let stateJson = null;
if (stateBytes !== undefined) {
let stateText = new TextDecoder().decode(stateBytes);
stateJson = JSON.parse(stateText) as BugLessState;
stateJson = JSON.parse(stateText) as BugBusterState;
} else {
stateJson = { bounties: [] };
}
Expand All @@ -118,7 +118,7 @@ function GetBounty(bountyIndex: number): ReaderResult<AppBounty> {
let stateJson = null;
if (stateBytes !== undefined) {
let stateText = new TextDecoder().decode(stateBytes);
stateJson = JSON.parse(stateText) as BugLessState;
stateJson = JSON.parse(stateText) as BugBusterState;
}
let bounty = stateJson?.bounties.at(bountyIndex);
let exploit = bounty?.exploit;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/model/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface BugLessState {
export interface BugBusterState {
bounties: AppBounty[];
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/providers/walletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ const wagmiConfig = defaultWagmiConfig({
chains,
projectId,
metadata: {
name: "Bugless",
name: "Bug Buster",
description: "Trustless bug bounties",
url: "https://github.com/crypto-bug-hunters/bugless",
url: "https://github.com/crypto-bug-hunters/bug-buster",
},
});

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module bugless
module bug-buster

go 1.22.0

Expand Down
6 changes: 3 additions & 3 deletions populate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Find bugs in Lua, a powerful, efficient, lightweight, embeddable scripting langu
Submitted Lua code will run inside a sanboxed Lua environment, to win the bounty the code must crash its interpreter or escape the sandbox and exit with segmentation fault status (code 139).
The source code of the bounty can be inspected at:
https://github.com/crypto-bug-hunters/bugless/tree/main/tests/bounties/lua-bounty
https://github.com/crypto-bug-hunters/bug-buster/tree/main/tests/bounties/lua-bounty
END
)

Expand All @@ -26,7 +26,7 @@ Find bugs in SQLite, the most used database engine in the world!
Submitted SQL code will run inside a SQLite safe shell open on an empty database, to win the bounty the SQL code must crash the SQLite shell.
The source code of the bounty can be inspected at:
https://github.com/crypto-bug-hunters/bugless/tree/main/tests/bounties/sqlite-bounty
https://github.com/crypto-bug-hunters/bug-buster/tree/main/tests/bounties/sqlite-bounty
END
)

Expand All @@ -39,7 +39,7 @@ Did you know it is one of the most downloaded software in Docker Hub, with more
Submitted shell code will run inside a BusyBox with only ash utility enabled, to win this bounty the shell code must crash it.
The source code of the bounty can be inspected at:
https://github.com/crypto-bug-hunters/bugless/tree/main/tests/bounties/busybox-bounty
https://github.com/crypto-bug-hunters/bug-buster/tree/main/tests/bounties/busybox-bounty
END
)

Expand Down
4 changes: 2 additions & 2 deletions shared/bugless.go → shared/bug-buster.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
// Application state
//

type BugLessState struct {
type BugBusterState struct {
Bounties []*AppBounty `json:"bounties"`
}

func (s *BugLessState) GetBounty(bountyIndex int) *AppBounty {
func (s *BugBusterState) GetBounty(bountyIndex int) *AppBounty {
if bountyIndex >= len(s.Bounties) {
return nil
}
Expand Down
Loading

0 comments on commit 23199fd

Please sign in to comment.