Skip to content

Commit

Permalink
Update contributing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhijie committed Jan 10, 2022
1 parent 439840a commit 51e7373
Showing 1 changed file with 52 additions and 5 deletions.
57 changes: 52 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Creates a new web3 instance with http provider.

```golang
// change to your rpc provider
var infuraURL = "https://mainnet.infura.io/v3/<API-Key>"
web3, err := web3.NewWeb3(infuraURL)
var rpcProviderURL = "https://rpc.flashbots.net"
web3, err := web3.NewWeb3(rpcProviderURL)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -93,9 +93,24 @@ fmt.Println("Latest nonce: ", nonce)
Init contract api

```golang
abiString := "" // abi string
contractAddr := "" // contract address
contract, err := web3.Eth.NewContract(abiString, contractAddr )
abiString := `[
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]`
contractAddr := "0x6B175474E89094C44Da98b954EedeAC495271d0F" // contract address
contract, err := web3.Eth.NewContract(abiString, contractAddr)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -158,6 +173,38 @@ fmt.Printf("Send approve tx hash %v\n", txHash)
- **[Contract API](./examples/contract/erc20.go)**
- **[EIP1559 API](./examples/eip1559/main.go)**

## Contributing

Go-Web3 welcome contributions. Please follow the guidelines when opening issues and contributing code to the repo.

### Contributing

We follow the [fork-and-pull](https://help.github.com/en/articles/about-collaborative-development-models) Git workflow:

1. **Fork** the repo on GitHub
2. **Clone** it to your own machine
3. **Commit** changes to your fork
4. **Push** changes to your fork
5. Submit a **Pull request** for review

**NOTE:** Be sure to merge the latest changes before making a pull request!

### Pull Requests

As outlined in Keavy McMinn's article ["How to write the perfect pull request"](https://github.blog/2015-01-21-how-to-write-the-perfect-pull-request/), you should include:

1. The purpose of the PR
2. A brief overview of what you did
3. Tag any issues that the PR relates to and [close issues with a keyword](https://help.github.com/en/articles/closing-issues-using-keywords)
4. What kind of feedback you're looking for (if any)
5. Tag individuals you want feedback from (if any)

### Issues

Feel free to submit issues and enhancement requests [here](https://github.com/chenzhijie/go-web3/issues/new). Please consider [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and take the time to research your issue before asking for help.

Duplicate questions will be closed.

## License

The go-web3 source code is available under the [LGPL-3.0](LICENSE) license.

0 comments on commit 51e7373

Please sign in to comment.