Skip to content

Commit

Permalink
updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lmittmann committed Sep 4, 2024
1 parent ed676b4 commit 8fa4c6c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions docs/pages/helper-abi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,26 @@ Function signatures are defined using Solidity syntax. Arguments and returns can

#### `ERC20.balanceOf`

```go
ABI binding for the `ERC20.balanceOf` function ([Playground](https://pkg.go.dev/github.com/lmittmann/w3#example-NewFunc-BalanceOf)):

```solidity filename="Solidity"
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
// ...
}
```

```go
```go filename="Go"
var funcBalanceOf = w3.MustNewFunc("balanceOf(address)", "uint256")
// or
var funcBalanceOf = w3.MustNewFunc("balanceOf(address who)", "uint256 amount")
```

#### Uniswap `QuoterV2.quoteExactInputSingle`

```solidity
ABI binding for the `QuoterV2.quoteExactInputSingle` function:

```solidity filename="Solidity"
interface QuoterV2 {
struct QuoteExactInputSingleParams {
Expand All @@ -61,7 +65,7 @@ interface QuoterV2 {
}
```

```go
```go filename="Go"
type QuoteExactInputSingleParams struct {
TokenIn common.Address
TokenOut common.Address
Expand All @@ -85,6 +89,10 @@ var funcQuoteExactInputSingle = w3.MustNewFunc(
)
```

### Tuples

---


### Examples

Expand Down

0 comments on commit 8fa4c6c

Please sign in to comment.