Skip to content

Commit

Permalink
chore(editor): fixed build types
Browse files Browse the repository at this point in the history
  • Loading branch information
developerfred committed Jan 29, 2024
1 parent 7af0e4b commit 58bc312
Show file tree
Hide file tree
Showing 172 changed files with 1,486 additions and 1,365 deletions.
7 changes: 0 additions & 7 deletions components/Editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,6 @@ const Editor = ({ readOnly = false }: Props) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

useEffect(() => {
if (solcWorkerRef && solcWorkerRef.current) {
// @ts-ignore change the worker message, when value and args changed.
solcWorkerRef.current?.onmessage = handleWorkerMessage
}
}, [solcWorkerRef, handleWorkerMessage])

useEffect(() => {
if (deployedContractAddress) {
log(`Contract deployed at address: ${deployedContractAddress}`)
Expand Down
28 changes: 9 additions & 19 deletions components/KBar/Results.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
import { useMemo } from 'react'

import { KBarResults, useMatches } from 'kbar'
import type { ActionImpl } from 'kbar'

import ResultItem from './ResultItem'

const NO_GROUP = 'none'

const Results = () => {
const { results } = useMatches()
const groups = useMatches()

const flattened = useMemo(() => {
const flattenActions = (actions: (string | ActionImpl)[]) => {
return actions.reduce((acc: any[], curr: string | ActionImpl) => {
if (typeof curr === 'string') {
acc.push(curr)
} else {
acc.push(curr)

if (curr.children && curr.children.length > 0) {
acc.push(...flattenActions(curr.children))
}
}
if (groups && Array.isArray(groups)) {
return groups.reduce((acc: any, curr: any) => {
acc.push(curr.name)
acc.push(...curr.actions)
return acc
}, [])
} else {
return []
}

return flattenActions(results)
}, [results])
}, [groups])

return (
<KBarResults
items={flattened.filter(
(i: any) => typeof i !== 'string' || i !== NO_GROUP,
)}
items={flattened.filter((i: string) => i !== NO_GROUP)}
onRender={({ item, active }) =>
typeof item === 'string' ? (
<div className="px-4 py-2 text-2xs uppercase text-gray-400 dark:text-gray-600 bg-white dark:bg-black-600">
Expand Down
11 changes: 6 additions & 5 deletions docs/opcodes/01.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Stack input

Expand All @@ -16,15 +16,16 @@ group: Stop and Arithmetic Operations

## Examples

| * | Input | Output | * | * | Input | Output |
|--:|------:|-------:|--:|--:|------:|-------:|
| `1` | `10` | `20` | * | `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | `0` |
| `2` | `10` | | * | `2` | `1` | |
| \* | Input | Output | \* | \* | Input | Output |
| --: | ----: | -----: | --: | --: | -------------------------------------------------------------------: | -----: |
| `1` | `10` | `20` | \* | `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | `0` |
| `2` | `10` | | \* | `2` | `1` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='y1z0z0twwy2v32%200xsssszt'~uuuuzv1%201y%2F%2F%20Example%20w%5CnvwPUSHuFFtwADDs~~%01stuvwyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
17 changes: 9 additions & 8 deletions docs/opcodes/02.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Stack input

Expand All @@ -16,20 +16,21 @@ group: Stop and Arithmetic Operations

## Examples

| * | Input | Output |
|--:|------:|-------:|
| `1` | `10` | `100` |
| `2` | `10` | |
| \* | Input | Output |
| --: | ----: | -----: |
| `1` | `10` | `100` |
| `2` | `10` | |

| * | Input | Output |
|--:|------:|-------:|
| \* | Input | Output |
| --: | -------------------------------------------------------------------: | -------------------------------------------------------------------: |
| `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE` |
| `2` | `2` | |
| `2` | `2` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='y1z10z10twwy2v32%200xssssz2t'~uuuuzv1%20y%2F%2F%20Example%20w%5CnvwPUSHuFFtwMULs~~%01stuvwyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
11 changes: 6 additions & 5 deletions docs/opcodes/03.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Stack input

Expand All @@ -16,15 +16,16 @@ group: Stop and Arithmetic Operations

## Examples

| * | Input | Output | * | * | Input | Output |
|--:|------:|-------:|--:|--:|------:|-------:|
| `1` | `10` | `0` | * | `1` | `0` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` |
| `2` | `10` | | * | `2` | `1` | |
| \* | Input | Output | \* | \* | Input | Output |
| --: | ----: | -----: | --: | --: | ----: | -------------------------------------------------------------------: |
| `1` | `10` | `0` | \* | `1` | `0` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` |
| `2` | `10` | | \* | `2` | `1` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='z1~10~1wyyz2~1~w'~yPUSH1%20z%2F%2F%20Example%20y%5Cnw0ySUB%01wyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
11 changes: 6 additions & 5 deletions docs/opcodes/04.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Stack input

Expand All @@ -16,15 +16,16 @@ group: Stop and Arithmetic Operations

## Examples

| * | Input | Output | * | * | Input | Output |
|--:|------:|-------:|--:|--:|------:|-------:|
| `1` | `10` | `1` | * | `1` | `1` | `0` |
| `2` | `10` | | * | `2` | `2` | |
| \* | Input | Output | \* | \* | Input | Output |
| --: | ----: | -----: | --: | --: | ----: | -----: |
| `1` | `10` | `1` | \* | `1` | `1` | `0` |
| `2` | `10` | | \* | `2` | `2` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='z1~10~10wyyz2~2~1w'~yPUSH1%20z%2F%2F%20Example%20y%5CnwyDIV%01wyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
11 changes: 6 additions & 5 deletions docs/opcodes/05.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Notes

Expand All @@ -20,15 +20,16 @@ All values are treated as two’s complement signed 256-bit integers. Note the o

## Examples

| * | Input | Output | * | * | Input | Output |
|--:|------:|-------:|--:|--:|------:|-------:|
| `1` | `10` | `1` | * | `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE` | `2` |
| `2` | `10` | | * | `2` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | |
| \* | Input | Output | \* | \* | Input | Output |
| --: | ----: | -----: | --: | --: | -------------------------------------------------------------------: | -----: |
| `1` | `10` | `1` | \* | `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE` | `2` |
| `2` | `10` | | \* | `2` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='y1vvszzy2wrFwrEs'~uuuz%5Cny%2F%2F%20Example%20wt32%200xr~vt1%2010uFFFtzPUSHszSDIVr~~~%01rstuvwyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
11 changes: 6 additions & 5 deletions docs/opcodes/06.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Stack input

Expand All @@ -16,15 +16,16 @@ group: Stop and Arithmetic Operations

## Examples

| * | Input | Output | * | * | Input | Output |
|--:|------:|-------:|--:|--:|------:|-------:|
| `1` | `10` | `1` | * | `1` | `17` | `2` |
| `2` | `3` | | * | `2` | `5` | |
| \* | Input | Output | \* | \* | Input | Output |
| --: | ----: | -----: | --: | --: | ----: | -----: |
| `1` | `10` | `1` | \* | `1` | `17` | `2` |
| `2` | `3` | | \* | `2` | `5` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='z1~3~10wyyz2~5~17w'~yPUSH1%20z%2F%2F%20Example%20y%5CnwyMOD%01wyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
17 changes: 9 additions & 8 deletions docs/opcodes/07.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Notes

Expand All @@ -20,20 +20,21 @@ All values are treated as two’s complement signed 256-bit integers. Note the o

## Examples

| * | Input | Output |
|--:|------:|-------:|
| `1` | `10` | `1` |
| `2` | `3` | |
| \* | Input | Output |
| --: | ----: | -----: |
| `1` | `10` | `1` |
| `2` | `3` | |

| * | Input | Output |
|--:|------:|-------:|
| \* | Input | Output |
| --: | -------------------------------------------------------------------: | -------------------------------------------------------------------: |
| `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE` |
| `2` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD` | |
| `2` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='y1s3s10tzzy2wrDwr8t'~uuuz%5Cny%2F%2F%20Example%20wv32%200xr~vzPUSHuFFFtzSMODsv1%20r~~~%01rstuvwyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
13 changes: 7 additions & 6 deletions docs/opcodes/08.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Notes

Expand All @@ -21,16 +21,17 @@ All intermediate calculations of this operation are not subject to the 2<sup>256

## Examples

| * | Input | Output | * | * | Input | Output |
|--:|------:|-------:|--:|--:|------:|-------:|
| `1` | `10` | `4` | * | `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | `1` |
| `2` | `10` | | * | `2` | `2` | |
| `3` | `8` | | * | `2` | `2` | |
| \* | Input | Output | \* | \* | Input | Output |
| --: | ----: | -----: | --: | --: | -------------------------------------------------------------------: | -----: |
| `1` | `10` | `4` | \* | `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | `1` |
| `2` | `10` | | \* | `2` | `2` | |
| `3` | `8` | | \* | `2` | `2` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='y1z8z10z10vwwy2z2z2u32%200xssssv'~ttttzu1%20y%2F%2F%20Example%20w%5CnvwADDMODuwPUSHtFFs~~%01stuvwyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
13 changes: 7 additions & 6 deletions docs/opcodes/09.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Notes

Expand All @@ -21,16 +21,17 @@ All intermediate calculations of this operation are not subject to the 2<sup>256

## Examples

| * | Input | Output | * | * | Input | Output |
|--:|------:|-------:|--:|--:|------:|-------:|
| `1` | `10` | `4` | * | `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | `9` |
| `2` | `10` | | * | `2` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | |
| `3` | `8` | | * | `3` | `12` | |
| \* | Input | Output | \* | \* | Input | Output |
| --: | ----: | -----: | --: | --: | -------------------------------------------------------------------: | -----: |
| `1` | `10` | `4` | \* | `1` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | `9` |
| `2` | `10` | | \* | `2` | `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` | |
| `3` | `8` | | \* | `3` | `12` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='y1v8v10v10twwy2v12usust'~rrrrzwPUSHy%2F%2F%20Example%20w%5Cnvz1%20uz32%200xstwMULMODs~~~~rFF%01rstuvwyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
11 changes: 6 additions & 5 deletions docs/opcodes/0A.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fork: Frontier
group: Stop and Arithmetic Operations
---

*Index 1 is top of the stack. See [PUSH](/#60).*
_Index 1 is top of the stack. See [PUSH](/#60)._

## Stack input

Expand All @@ -16,15 +16,16 @@ group: Stop and Arithmetic Operations

## Examples

| * | Input | Output | * | * | Input | Output |
|--:|------:|-------:|--:|--:|------:|-------:|
| `1` | `10` | `100` | * | `1` | `2` | `4` |
| `2` | `2` | | * | `2` | `2` | |
| \* | Input | Output | \* | \* | Input | Output |
| --: | ----: | -----: | --: | --: | ----: | -----: |
| `1` | `10` | `100` | \* | `1` | `2` | `4` |
| `2` | `2` | | \* | `2` | `2` | |

[Reproduce in playground](/playground?unit=Wei&codeType=Mnemonic&code='z1~2~10wyyz2~2~2w'~yPUSH1%20z%2F%2F%20Example%20y%5CnwyEXP%01wyz~_).

## Error cases

The state changes done by the current context are [reverted](#FD) in those cases:

- Not enough gas.
- Not enough values on the stack.
Loading

0 comments on commit 58bc312

Please sign in to comment.