diff --git a/NOTICE b/NOTICE index c548f6c..080d5a9 100644 --- a/NOTICE +++ b/NOTICE @@ -1,2 +1,2 @@ -SpecialOps +SpecOps Copyright 2024 Arran Schlosberg \ No newline at end of file diff --git a/README.md b/README.md index 9ac4611..cbb6908 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# SpecialOps [![Go](https://github.com/solidifylabs/specialops/actions/workflows/go.yml/badge.svg)](https://github.com/solidifylabs/specialops/actions/workflows/go.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/solidifylabs/specialops.svg)](https://pkg.go.dev/github.com/solidifylabs/specialops) +# SpecOps [![Go](https://github.com/solidifylabs/specops/actions/workflows/go.yml/badge.svg)](https://github.com/solidifylabs/specops/actions/workflows/go.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/solidifylabs/specops.svg)](https://pkg.go.dev/github.com/solidifylabs/specops) -> `specialops` is a low-level, domain-specific language (and compiler) for crafting [Ethereum VM](https://ethereum.org/en/developers/docs/evm) bytecode in Go. +> `specops` is a low-level, domain-specific language (and compiler) for crafting [Ethereum VM](https://ethereum.org/en/developers/docs/evm) bytecode in Go. This is a _very_ early release. In fact, it's just a weekend project gone rogue so is less than a week old. @@ -44,22 +44,22 @@ bytecode unchanged. ### Documentation -The [`specialops` Go -documentation](https://pkg.go.dev/github.com/solidifylabs/specialops) covers all +The [`specops` Go +documentation](https://pkg.go.dev/github.com/solidifylabs/specops) covers all functionality. ## Examples ### Hello world -TODO: link to Go playground; for now, here's the [real implementation](https://github.com/solidifylabs/specialops/blob/41efe932c9a85e45ce705b231577447e6c944487/examples_test.go#L12). +TODO: link to Go playground; for now, here's the [real implementation](https://github.com/solidifylabs/specops/blob/41efe932c9a85e45ce705b231577447e6c944487/examples_test.go#L12). -The `specialops` Go package has a minimal footprint to allow for dot-importing, +The `specops` Go package has a minimal footprint to allow for dot-importing, making all exported symbols available. TODO: expand on the implications, rationale, and recommendations as this goes against the style guide. ```go -import . github.com/solidifylabs/specialops +import . github.com/solidifylabs/specops … @@ -98,14 +98,14 @@ result, err := results() ### Other examples -- [Verbatim reimplementation of well-known contracts](https://github.com/solidifylabs/specialops/blob/41efe932c9a85e45ce705b231577447e6c944487/examples_test.go#L34) +- [Verbatim reimplementation of well-known contracts](https://github.com/solidifylabs/specops/blob/41efe932c9a85e45ce705b231577447e6c944487/examples_test.go#L34) * EIP-1167 Minimal Proxy ([original](https://eips.ethereum.org/EIPS/eip-1167#specification)) * 0age/metamorphic ([original](https://github.com/0age/metamorphic/blob/55adac1d2487046002fc33a5dff7d669b5419a3a/contracts/MetamorphicContractFactory.sol#L55)) -- [Monte Carlo approximation of pi](https://github.com/solidifylabs/specialops/blob/41efe932c9a85e45ce705b231577447e6c944487/examples_test.go#L158) -- [`sqrt()`](https://github.com/solidifylabs/specialops/blob/41efe932c9a85e45ce705b231577447e6c944487/examples_test.go#L246) as seen ~~on TV~~ in `prb-math` ([original](https://github.com/PaulRBerg/prb-math/blob/5b6279a0cf7c1b1b6a5cc96082811f7ef620cf60/src/Common.sol#L595)) +- [Monte Carlo approximation of pi](https://github.com/solidifylabs/specops/blob/41efe932c9a85e45ce705b231577447e6c944487/examples_test.go#L158) +- [`sqrt()`](https://github.com/solidifylabs/specops/blob/41efe932c9a85e45ce705b231577447e6c944487/examples_test.go#L246) as seen ~~on TV~~ in `prb-math` ([original](https://github.com/PaulRBerg/prb-math/blob/5b6279a0cf7c1b1b6a5cc96082811f7ef620cf60/src/Common.sol#L595)) ## Acknowledgements -Some of SpecialOps was, of course, inspired by +Some of SpecOps was, of course, inspired by [Huff](https://github.com/huff-language). I hope to provide something different, of value, and to inspire them too. diff --git a/compile.go b/compile.go index c573f29..5041401 100644 --- a/compile.go +++ b/compile.go @@ -1,4 +1,4 @@ -package specialops +package specops import ( "bytes" @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/core/vm" - "github.com/solidifylabs/specialops/types" + "github.com/solidifylabs/specops/types" ) // A splice is a (possibly empty) buffer of bytecode, followed by either a diff --git a/examples_test.go b/examples_test.go index c7c6ea5..38c7c5c 100644 --- a/examples_test.go +++ b/examples_test.go @@ -1,4 +1,4 @@ -package specialops +package specops import ( "fmt" @@ -33,7 +33,7 @@ func Example_helloWorld() { func ExampleCode_wellKnown() { // This example demonstrates some well-known bytecode examples implemented - // with `specialops`: + // with `specops`: // // - EIP-1167 Minimal Proxy Contract // - 0age/metamorphic Metamorphic contract constructor https://github.com/0age/metamorphic/blob/55adac1d2487046002fc33a5dff7d669b5419a3a/contracts/MetamorphicContractFactory.sol#L55 diff --git a/go.mod b/go.mod index 93161a8..5df0d8a 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/solidifylabs/specialops +module github.com/solidifylabs/specops go 1.20 diff --git a/internal/opcopy/main.go b/internal/opcopy/main.go index affac7d..8bc6a9e 100644 --- a/internal/opcopy/main.go +++ b/internal/opcopy/main.go @@ -1,4 +1,4 @@ -// The opcopy binary generates a Go file for use in the `specialops` package. +// The opcopy binary generates a Go file for use in the `specops` package. // It mirrors all EVM opcodes that don't have special representations, and // provides a mapping from all opcodes to the number of values they pop/push // from the stack. @@ -63,7 +63,7 @@ func run() error { } } - tmpl := template.Must(template.New("go").Parse(`package specialops + tmpl := template.Must(template.New("go").Parse(`package specops // // GENERATED CODE - DO NOT EDIT diff --git a/opcodes.gen.go b/opcodes.gen.go index 88885f4..f0574e6 100644 --- a/opcodes.gen.go +++ b/opcodes.gen.go @@ -1,4 +1,4 @@ -package specialops +package specops // // GENERATED CODE - DO NOT EDIT diff --git a/run.go b/run.go index ebcf2fb..978feb8 100644 --- a/run.go +++ b/run.go @@ -1,4 +1,4 @@ -package specialops +package specops import ( "fmt" @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/params" - "github.com/solidifylabs/specialops/runopts" + "github.com/solidifylabs/specops/runopts" ) // Run calls c.Compile() and runs the compiled bytecode on a freshly diff --git a/runopts/debugger_test.go b/runopts/debugger_test.go index 4273365..2fdb643 100644 --- a/runopts/debugger_test.go +++ b/runopts/debugger_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/ethereum/go-ethereum/core/vm" - . "github.com/solidifylabs/specialops" + . "github.com/solidifylabs/specops" ) func TestDebugger(t *testing.T) { diff --git a/runopts/runopts.go b/runopts/runopts.go index a909afc..aeb68c7 100644 --- a/runopts/runopts.go +++ b/runopts/runopts.go @@ -1,4 +1,4 @@ -// Package runopts provides configuration options for specialops.Code.Run(). +// Package runopts provides configuration options for specops.Code.Run(). package runopts import ( @@ -7,7 +7,7 @@ import ( ) // A Configuration carries all values that can be modified to configure a call -// to specialops.Code.Run(). It is intially set by Run() and then passed to all +// to specops.Code.Run(). It is intially set by Run() and then passed to all // Options to be modified. type Configuration struct { // vm.NewEVM() diff --git a/specialops.go b/specialops.go index 369bce7..3e453d4 100644 --- a/specialops.go +++ b/specialops.go @@ -1,4 +1,4 @@ -// Package specialops implements a DSL for crafting raw EVM bytecode. It +// Package specops implements a DSL for crafting raw EVM bytecode. It // provides "special" opcodes as drop-in replacements for regular ones, e.g. // JUMPDEST labels, PUSH aliases, and DUP/SWAP from the bottom of the stack. // It also provides pseudo opcodes that act as compiler hints. @@ -7,7 +7,7 @@ // available in the importing package, allowing a mnemonic-style programming // environment akin to writing assembly. As a result, there are few top-level // identifiers. -package specialops +package specops import ( "encoding/binary" @@ -19,7 +19,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/holiman/uint256" - "github.com/solidifylabs/specialops/types" + "github.com/solidifylabs/specops/types" ) // Code is a slice of Bytecoders; it is itself a Bytecoder, allowing for diff --git a/specialops_test.go b/specialops_test.go index 663f5d3..3688b4d 100644 --- a/specialops_test.go +++ b/specialops_test.go @@ -1,4 +1,4 @@ -package specialops +package specops import ( "bytes" @@ -11,7 +11,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/google/go-cmp/cmp" "github.com/holiman/uint256" - "github.com/solidifylabs/specialops/types" + "github.com/solidifylabs/specops/types" ) // mustRunByteCode propagates arguments to runBytecode, calling log.Fatal() on diff --git a/stack.go b/stack.go index ae69160..272979f 100644 --- a/stack.go +++ b/stack.go @@ -1,4 +1,4 @@ -package specialops +package specops import ( "fmt" diff --git a/types/types.go b/types/types.go index f425413..34c96d0 100644 --- a/types/types.go +++ b/types/types.go @@ -1,4 +1,4 @@ -// Package types defines types used by the specialops package, which is intended +// Package types defines types used by the specops package, which is intended // to be dot-imported so requires a minimal footprint of exported symbols. package types