moonstream-to / seer Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Currently, if a method argument or return type is a struct which contains a field that is a byte array (of arbitrary depth), then the code generated by seer evm generate
does not properly handle that field.
This is a somewhat deep issue caused by the behavior of encoding/json
.
There are a few solutions that come to mind:
seer evm generate
handles method arguments which are themselves byte arrays.encoding/json
which represents []byte
as string
when marshaling (and vice versa when unmarshaling).When generating code from this Dojo ABI: https://raw.githubusercontent.com/dojoengine/dojo/5a1176e8b00e11101410bda889c854bc5bef76d5/examples/spawn-and-move/abis/base/models/moves.json
All the ..._Felt252
types are buggy.
// Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252 is the Go struct corresponding to the core::array::Span::<(core::felt252, core::array::Span::<core::felt252>)> struct.
type Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252 struct {
Snapshot []core_Felt252Core_Array_Span_core_Felt252
}
// ParseCore_Array_Span_core_Felt252Core_Array_Span_core_Felt252 parses a Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252 struct from a list of felts. This function returns a tuple of:
// 1. The parsed Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252 struct
// 2. The number of field elements consumed in the parse
// 3. An error if the parse failed, nil otherwise
func ParseCore_Array_Span_core_Felt252Core_Array_Span_core_Felt252(parameters []*felt.Felt) (Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252, int, error) {
currentIndex := 0
result := Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252{}
value0, consumed, err := ParseArray[core_Felt252Core_Array_Span_core_Felt252](Parsecore_Felt252Core_Array_Span_core_Felt252)(parameters[currentIndex:])
if err != nil {
return result, 0, err
}
result.Snapshot = value0
currentIndex += consumed
return result, currentIndex, nil
}
Currently, users who are using one of these frameworks have to manually extract the ABI and bytecode into separate files from their build artifacts. This is unnecessary friction. Just having a flag like:
seer evm generate --foundry out/<contractfilename>/<contractname>.json ...
would make seer evm generate
a lot easier to use.
Record an entity with address, blockchain, memo passed via seer CLI during contract deployment.
When generating the CLI for L1OrbitGatewayRouter.sol, seer generated an odd flag called
---to-0
, three dashes instead of only two (--to-0
).
The unusual flag was noticed while calling the outbound-transfer
function.
For example, Multicall3.getBlockHash
mc/main.go:787:6: blockNumberRaw redeclared in this block mc/main.go:783:6: other declaration of blockNumberRaw
This will basically encode the function selector with arguments and print the resulting bytes to screen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.