Skip to content
Open

Pick #70

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
90bb988
Use docker as testutil (#82)
ferranbt Aug 15, 2021
904f12f
Add eth_getStorageAt endpoint (#83)
ferranbt Aug 15, 2021
6b12c2a
Add debug endpoint (#84)
ferranbt Aug 15, 2021
aa4f748
Update solidity compiler output + deprecate vyper (#85)
ferranbt Aug 15, 2021
32ac414
Add function to create a new Tuple Type (#86)
ferranbt Aug 19, 2021
f743c3c
Add Etherscan getContract api method (#87)
ferranbt Aug 24, 2021
27dd954
Add missing fields in solidity compile (#88)
ferranbt Aug 24, 2021
c25af6e
Add hash and block filter for state endpoints (#89)
ferranbt Aug 24, 2021
95a2552
Update transport.go (#63)
slawomir-pryczek Aug 25, 2021
f0dfd5e
Add etherscan test (#90)
ferranbt Aug 25, 2021
13a0ca7
Feature block tracker (#91)
ferranbt Sep 21, 2021
1a00db7
Add event signature to abigen (#92)
ferranbt Sep 21, 2021
72a8ff8
Add jsonrpc version to request (#94)
ferranbt Oct 24, 2021
0909b67
Add zero address/hash (#95)
ferranbt Oct 24, 2021
484419c
Add bytes to hash/address conversion (#96)
ferranbt Oct 24, 2021
118b8d8
Abigen test framework (#100)
ferranbt Oct 27, 2021
5da9ae1
Fix encoding (#101)
ferranbt Oct 29, 2021
253fcbd
Add golang highlighting to the examples! (#106)
l3gacyb3ta Nov 3, 2021
0d516aa
Fix parseMethodSignature without returns (#104)
ferranbt Nov 3, 2021
5e39e82
Add helper methods for encoding/decoding (#111)
ferranbt Nov 20, 2021
f64ee1d
Add json wallet support (#113)
ferranbt Nov 22, 2021
2060f20
Fix block encoding of txns (#114)
ferranbt Nov 22, 2021
38b507e
Add test for contract gas estimation (#116)
ferranbt Nov 23, 2021
2291ba9
Fix type array and add a test in encoding (#118)
ferranbt Nov 29, 2021
e590eac
Make certain fields in the Transaction object nullable (#119)
zivkovicmilos Dec 6, 2021
0cb44c2
Add a Key interface (#120)
ferranbt Dec 8, 2021
a62dc1e
Keccak (#121)
ferranbt Dec 8, 2021
f99eda2
Add EIP-55 (#123)
ferranbt Dec 10, 2021
58e3410
added new method to set maxConns limit for jsonrpc transport (#125)
munna0908 Dec 16, 2021
79572f9
Enable eip-1559 and eip-2930 on transaction struct (#127)
ferranbt Dec 29, 2021
ad7f564
Fix HexToHash/Address (#128)
ferranbt Dec 30, 2021
9a856dc
Best effort encoding + overload definitions (#131)
darioAnongba Jan 11, 2022
7c94128
Decode bare uint and int as 256 bytes (#135)
ferranbt Jan 11, 2022
118e6ef
Encode strings to number as big.Int (#139)
darioAnongba Jan 12, 2022
157826f
Fix parse func types in NewMethod (#134)
ferranbt Jan 12, 2022
013846a
Handle error types (#136)
ferranbt Jan 12, 2022
a8fbcb8
Feat/headers adds header functionality to http and websockets (#140)
aBitUnique Jan 12, 2022
cbc80f2
fix: blocktracker (#142)
itcuihao Jan 17, 2022
725b9f4
Use header arg in websocket dialer for jsonrpc (#143)
r2d4 Jan 19, 2022
b6d93c3
Add missing Gas field to CallMsg (#145)
zivkovicmilos Jan 20, 2022
51e43f9
Correct the topic field in log filters (#147)
zivkovicmilos Feb 2, 2022
4620059
Add ens module (#148)
ferranbt Feb 6, 2022
1d971ac
Support hex strings as byte input args (#150)
ggarri Feb 14, 2022
0b2d679
Add unpack for evm revert errors (#151)
ferranbt Feb 15, 2022
fa97940
Add keystore encrypt/decrypt module (#152)
ferranbt Feb 19, 2022
19d7ba3
Add keystore v4 (#153)
ferranbt Feb 19, 2022
e1982f4
Use lower case fields in json file (#154)
ferranbt Feb 20, 2022
aaa1038
Add status to receipt (#156)
ferranbt Feb 24, 2022
6f7d16b
Rename go-web3 to ethgo (#158)
ferranbt Mar 3, 2022
1761cf9
Fix website refs (#162)
ferranbt Mar 3, 2022
1621d9f
Add plausible web tracker (#163)
ferranbt Mar 3, 2022
8907487
Add Cmd (#164)
ferranbt Mar 5, 2022
5019505
Add goreleaser (#165)
ferranbt Mar 5, 2022
2e51d36
Contract revamp (#167)
ferranbt Mar 10, 2022
88d505b
Decode fixed bytes in topic (#168)
ferranbt Mar 11, 2022
c08b5f6
Add copy functions for core types (#169)
ferranbt Mar 11, 2022
8815b43
Add etherscan getLogs endpoint (#172)
ferranbt Mar 22, 2022
d753735
Add ethers testcases (#177)
ferranbt Mar 31, 2022
6181cfb
Feat 4byte (#178)
ferranbt Apr 5, 2022
c0024dd
Add etherscan gas price (#182)
ferranbt Apr 7, 2022
91240b7
Add nonce when sending transaction in contract (#185)
ferranbt Apr 15, 2022
16ada0d
Release v0.1.1 (#188)
ferranbt Apr 25, 2022
bffbef0
Update goreleaser (#189)
ferranbt Apr 25, 2022
ca02305
Do not decode To if it doesn't exist (#190)
Apr 25, 2022
76ba1f4
Update testserver to v1.10.5 (#191)
ferranbt Apr 27, 2022
41020fa
Add fee history rpc call (#192)
ferranbt Apr 27, 2022
361ad04
Add ethersjs testcases (#193)
ferranbt May 4, 2022
980c5ac
Use block input in Call (#194)
ferranbt May 4, 2022
68e8a69
Fix signature of typed transactions (#197)
ferranbt May 4, 2022
dffc7cc
Add ens command (#196)
ferranbt May 4, 2022
1809604
Add custom opts in transaction (#195)
ferranbt May 4, 2022
c3af4df
Add eip-1559 (#198)
ferranbt May 5, 2022
f4aab7d
Update to new btcd release (#199)
ferranbt May 5, 2022
ceee521
Release 0.1.2 (#200)
ferranbt May 5, 2022
c1d8327
add JSON RPC parameter like on http transport (#201)
everestcw May 19, 2022
37ddc01
fix index out of range (DoS) in txn unmarshalling (#203)
shouc May 27, 2022
f6037f0
Update fastrlp (#204)
ferranbt Jun 1, 2022
d96bb6f
Add bound check to abi encoder (#205)
ferranbt Jun 13, 2022
74ed092
Release 0.1.2 (#206)
ferranbt Jun 13, 2022
8326bf6
Release 0.1.3 (#207)
ferranbt Jun 13, 2022
c8ac329
Expect the correct JSON/RPC results from eth_getFilterChanges calls (…
peterbroadhurst Jul 22, 2022
59d58ad
ENS supports reverse resolve (#210)
RoCry Aug 1, 2022
2300ead
Use custom tag for DecodeStruct (#211)
ferranbt Aug 2, 2022
a7c2d01
Parse multiline abi function (#212)
ferranbt Aug 10, 2022
be4553d
Fix copy method@ (#220)
ferranbt Oct 13, 2022
b9631fe
Fix Receipt decode (#221)
ferranbt Oct 13, 2022
18cb320
Move boltdb to bbolt repo (#222)
Oct 19, 2022
f671bdb
fix strings.ToLower wrong replacement in abi encoding, was lower casi…
cyberhorsey Oct 31, 2022
7b10bd2
Move test server outside tests (#229)
ferranbt Nov 17, 2022
b81ef2f
Parse block nonce and mixhash (#228)
ferranbt Nov 17, 2022
be4489e
Fix deployment of testutil server (#230)
ferranbt Nov 21, 2022
944f5f9
Fix again (#231)
ferranbt Nov 21, 2022
7658a30
Add internal type to abi type (#234)
ferranbt Jan 26, 2023
6a4d025
Bug decode abi bytes (#235)
ferranbt Jan 26, 2023
c54938f
Add Discord badge (#237)
ferranbt Feb 6, 2023
57292dc
Revert "contract/contract.go: add must send transaction"
laizy Jul 22, 2021
b5b5517
support read artifact from hardhat project
laizy Jul 23, 2021
dd42136
init evm from ontology
laizy Jul 24, 2021
fdf629a
Revert "contract/contract.go: add must send transaction"
laizy Jul 26, 2021
c8f642a
Revert "contract/contract.go: add must send transaction"
laizy Jul 26, 2021
b37fcdd
merge
Mar 7, 2023
c456249
add console precompile contract
laizy Jul 27, 2021
fbf90da
fix
Mar 9, 2023
83f4d71
unify transaction execution api
laizy Jul 29, 2021
18d442c
add decode tx input function
laizy Aug 2, 2021
dd0e1df
update
laizy Aug 3, 2021
71c2ab5
update
laizy Aug 9, 2021
4dfd5db
remove ethereum dependence
laizy Aug 17, 2021
9a5d71e
remove uint256 dependence
laizy Aug 24, 2021
7d6b2bc
fix rpc with hardhat node
laizy Aug 24, 2021
70dfb64
add trace rpc param
laizy Aug 25, 2021
6947b63
fix hardhat node's get storage bug
laizy Aug 25, 2021
7906c9a
pretty print receipt
laizy Aug 26, 2021
51df41b
add receipt status
lucas7788 Aug 26, 2021
d339b67
generate runtime bin code
laizy Aug 26, 2021
ecaf1aa
handle hex to hash error
laizy Aug 27, 2021
ca84640
fix memory bug shared by area
laizy Aug 27, 2021
7af1674
add load json file util function
laizy Aug 27, 2021
4d48256
expose decode revert function (#5)
laizy Aug 30, 2021
089476d
fix
Mar 9, 2023
764875c
setup github action (#4)
laizy Sep 6, 2021
df01f9f
add FilterLogs func for contract (#2)
lucas7788 Sep 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 0 additions & 22 deletions .circleci/config.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Format
run: bash ./scripts/github-action.gofmt.sh

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
23 changes: 23 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit tests
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
name: Go test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- name: Install ethers testcases
run: cd ./testcases && npm install
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: "1.18.1"
- name: "Setup"
run: ./scripts/setup-ci.sh
- name: "Setup geth"
run: ./scripts/setup-geth.sh
- name: Go test
run: go test -v ./...
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
workflow_dispatch:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
# to be used by fork patch-releases ^^
- 'v*.*.*-*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch all tags
run: git fetch --force --tags
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: '1.18.1'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bin/
pkg/
pkg/
/.idea
28 changes: 28 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
before:
hooks:
- go mod tidy
builds:
- dir: cmd
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
51 changes: 51 additions & 0 deletions 4byte/4byte.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package fourbyte

import (
"encoding/hex"
"encoding/json"
"io/ioutil"
"net/http"
)

const (
fourByteURL = "https://www.4byte.directory"
)

// Resolve resolves a method/event signature
func Resolve(str string) (string, error) {
return get("/api/v1/signatures/?hex_signature=" + str)
}

// ResolveBytes resolves a method/event signature in bytes
func ResolveBytes(b []byte) (string, error) {
return Resolve(hex.EncodeToString(b))
}

func get(path string) (string, error) {
req, err := http.Get(fourByteURL + path)
if err != nil {
return "", err
}
defer req.Body.Close()

data, err := ioutil.ReadAll(req.Body)
if err != nil {
return "", err
}

var result struct {
Results []signatureResult
}
if err := json.Unmarshal(data, &result); err != nil {
return "", err
}

if len(result.Results) == 0 {
return "", nil
}
return result.Results[0].TextSignature, nil
}

type signatureResult struct {
TextSignature string `json:"text_signature"`
}
30 changes: 30 additions & 0 deletions 4byte/4byte_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package fourbyte

import (
"testing"

"github.com/stretchr/testify/assert"
)

func Test4Byte(t *testing.T) {
t.Skip("http api not stable, skip for now")

var cases = []struct {
in, out string
}{
{
"0xddf252ad",
"Transfer(address,address,uint256)",
},
{
"0x42842e0e",
"safeTransferFrom(address,address,uint256)",
},
}
for _, i := range cases {
found, err := Resolve(i.in)
assert.NoError(t, err)
assert.Equal(t, i.out, found)
}

}
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 0.1.4 (Unreleased)

- fix: Parse `nonce` and `mixHash` on `Block` [[GH-228](https://github.com/umbracle/ethgo/issues/228)]
- feat: `abi` decodes function string in multilines [[GH-212](https://github.com/umbracle/ethgo/issues/212)]
- feat: `abi` DecodeStruct uses the `abi` tag instead of the default `mapstructure` [[GH-211](https://github.com/umbracle/ethgo/issues/211)]
- feat: Implement `ens` reverse resolver [[GH-210](https://github.com/umbracle/ethgo/issues/210)]
- fix: Jsonrpc eth_getLogs request cannot return string [[GH-209](https://github.com/umbracle/ethgo/issues/209)]

# 0.1.3 (13 June, 2022)

- Fix out-of-bounds reading of bytes during ABI decoding [[GH-205](https://github.com/umbracle/ethgo/issues/205)]
- Update `fastrlp` to `59d5dd3` commit to fix a bug on bytes length check [[GH-204](https://github.com/umbracle/ethgo/issues/204)]
- Fix out-of-bounds RLP unmarshal of transactions [[GH-203](https://github.com/umbracle/ethgo/issues/203)]

# 0.1.2 (5 May, 2022)

- Update `btcd` library to new `v0.22.1`
- Add option in `contract` to send transactions with EIP-1559 [[GH-198](https://github.com/umbracle/ethgo/issues/198)]
- Add custom `TxnOpts` to send a transaction in `contract` [[GH-195](https://github.com/umbracle/ethgo/issues/195)]
- Add `ens resolve` command to resolve an ENS name [[GH-196](https://github.com/umbracle/ethgo/issues/196)]
- Fix signing of typed transactions [[GH-197](https://github.com/umbracle/ethgo/issues/197)]
- Fix. Use `ethgo.BlockNumber` input to make `Call` in contract [[GH-194](https://github.com/umbracle/ethgo/issues/194)]
- Add `testcases` for contract signature and transaction signing [[GH-193](https://github.com/umbracle/ethgo/issues/193)]
- Add `eth_feeHistory` rpc endpoint [[GH-192](https://github.com/umbracle/ethgo/issues/192)]
- Update `testserver` to `go-ethereum:v1.10.15` [[GH-191](https://github.com/umbracle/ethgo/issues/191)]
- Do not decode `to` in `Transaction` if not exists [[GH-190](https://github.com/umbracle/ethgo/issues/190)]

# 0.1.1 (25 April, 2022)

- Retrieve latest nonce when sending a transaction on `contract` [[GH-185](https://github.com/umbracle/ethgo/issues/185)]
- Add `etherscan.GasPrice` function to return last block gas price [[GH-182](https://github.com/umbracle/ethgo/issues/182)]
- Add `4byte` package and cli [[GH-178](https://github.com/umbracle/ethgo/issues/178)]
- Install and use `ethers.js` spec tests for wallet private key decoding [[GH-177](https://github.com/umbracle/ethgo/issues/177)]
- Add `GetLogs` function Etherscan to return logs by filter [[GH-170](https://github.com/umbracle/ethgo/issues/170)]
- Add `Copy` function to major data types [[GH-169](https://github.com/umbracle/ethgo/issues/169)]
- Parse `fixed bytes` type in event topic [[GH-168](https://github.com/umbracle/ethgo/issues/168)]
- Introduce `NodeProvider` and update `Contract` and `abigen` format. [[GH-167](https://github.com/umbracle/ethgo/issues/167)]

# 0.1.0 (5 March, 2022)

- Initial public release.
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,3 @@
build-artifacts:
@echo "--> Build Artifacts"
@sh -c ./scripts/build-artifacts.sh

.PHONY: build-abigen
build-abigen:
@echo "--> Build abigen"
@sh -c ./scripts/build-abigen.sh
Loading