-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into qdm12/libevm/metrics
- Loading branch information
Showing
50 changed files
with
787 additions
and
1,031 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,21 +18,8 @@ The Subnet EVM runs in a separate process from the main AvalancheGo process and | |
### AvalancheGo Compatibility | ||
|
||
```text | ||
[v0.6.0] [email protected] (Protocol Version: 33) | ||
[v0.6.1] [email protected] (Protocol Version: 33) | ||
[v0.6.2] [email protected] (Protocol Version: 34) | ||
[v0.6.3] [email protected] (Protocol Version: 35) | ||
[v0.6.4] [email protected] (Protocol Version: 35) | ||
[v0.6.5] [email protected] (Protocol Version: 35) | ||
[v0.6.6] [email protected] (Protocol Version: 35) | ||
[v0.6.7] [email protected] (Protocol Version: 35) | ||
[v0.6.8] [email protected] (Protocol Version: 36) | ||
[v0.6.9] [email protected] (Protocol Version: 37) | ||
[v0.6.10] [email protected] (Protocol Version: 37) | ||
[v0.6.11] [email protected] (Protocol Version: 37) | ||
[v0.6.12] [email protected]/v1.12.0 (Protocol Version: 38) | ||
[v0.7.0] [email protected] (Protocol Version: 38) | ||
[v0.7.1] [email protected].0-v1.12.1 (Protocol Version: 38) | ||
[v0.7.1] [email protected].2 (Protocol Version: 39) | ||
``` | ||
|
||
## API | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// (c) 2025, Ava Labs, Inc. All rights reserved. | ||
// See the file LICENSE for licensing terms. | ||
|
||
package bind | ||
|
||
import ( | ||
"fmt" | ||
"regexp" | ||
|
||
"github.com/ava-labs/subnet-evm/accounts/abi" | ||
) | ||
|
||
type ( | ||
// These types are exported for use in bind/precompilebind | ||
TmplContract = tmplContract | ||
TmplMethod = tmplMethod | ||
TmplStruct = tmplStruct | ||
) | ||
|
||
// BindHook is a callback function that can be used to customize the binding. | ||
type BindHook func(lang Lang, pkg string, types []string, contracts map[string]*tmplContract, structs map[string]*tmplStruct) (data any, templateSource string, err error) | ||
|
||
func IsKeyWord(arg string) bool { | ||
return isKeyWord(arg) | ||
} | ||
|
||
var bindTypeNew = map[Lang]func(kind abi.Type, structs map[string]*tmplStruct) string{ | ||
LangGo: bindTypeNewGo, | ||
} | ||
|
||
// bindTypeNewGo converts new types to Go ones. | ||
func bindTypeNewGo(kind abi.Type, structs map[string]*tmplStruct) string { | ||
switch kind.T { | ||
case abi.TupleTy: | ||
return structs[kind.TupleRawName+kind.String()].Name + "{}" | ||
case abi.ArrayTy: | ||
return fmt.Sprintf("[%d]", kind.Size) + bindTypeGo(*kind.Elem, structs) + "{}" | ||
case abi.SliceTy: | ||
return "nil" | ||
case abi.AddressTy: | ||
return "common.Address{}" | ||
case abi.IntTy, abi.UintTy: | ||
parts := regexp.MustCompile(`(u)?int([0-9]*)`).FindStringSubmatch(kind.String()) | ||
switch parts[2] { | ||
case "8", "16", "32", "64": | ||
return "0" | ||
} | ||
return "new(big.Int)" | ||
case abi.FixedBytesTy: | ||
return fmt.Sprintf("[%d]byte", kind.Size) + "{}" | ||
case abi.BytesTy: | ||
return "[]byte{}" | ||
case abi.FunctionTy: | ||
return "[24]byte{}" | ||
case abi.BoolTy: | ||
return "false" | ||
case abi.StringTy: | ||
return `""` | ||
default: | ||
return "nil" | ||
} | ||
} | ||
|
||
func mkList(args ...any) []any { | ||
return args | ||
} | ||
|
||
func add(a, b int) int { | ||
return a + b | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.