mirror of
https://github.com/grassrootseconomics/cic-go.git
synced 2025-07-06 10:22:49 +02:00
Compare commits
No commits in common. "master" and "v1.4.1" have entirely different histories.
@ -1,8 +0,0 @@
|
||||
version = 1
|
||||
|
||||
[[analyzers]]
|
||||
name = "go"
|
||||
enabled = true
|
||||
|
||||
[analyzers.meta]
|
||||
import_root = "github.com/grassrootseconomics/cic-go"
|
@ -1,5 +1,3 @@
|
||||
> DEPRECATED: Use https://github.com/grassrootseconomics/cic-go-sdk
|
||||
|
||||
[](https://pkg.go.dev/github.com/grassrootseconomics/cic_go)
|
||||
[](https://github.com/grassrootseconomics/cic_go/actions/workflows/go.yml)
|
||||
[](https://coveralls.io/github/grassrootseconomics/cic_go?branch=sohail/cic_net_updates)
|
||||
@ -24,4 +22,4 @@ import (
|
||||
cic_meta "github.com/grassrootseconomics/cic-go/meta"
|
||||
cic_net "github.com/grassrootseconomics/cic-go/net"
|
||||
)
|
||||
```
|
||||
```
|
@ -10,10 +10,9 @@ import (
|
||||
)
|
||||
|
||||
type ERC20Token struct {
|
||||
Name string
|
||||
Symbol string
|
||||
Decimals big.Int
|
||||
TotalSupply big.Int
|
||||
Name string
|
||||
Symbol string
|
||||
Decimals big.Int
|
||||
}
|
||||
|
||||
func (c *CicNet) ERC20TokenInfo(ctx context.Context, tokenAddress common.Address) (ERC20Token, error) {
|
||||
@ -21,7 +20,6 @@ func (c *CicNet) ERC20TokenInfo(ctx context.Context, tokenAddress common.Address
|
||||
tokenName string
|
||||
tokenSymbol string
|
||||
tokenDecimals big.Int
|
||||
totalSupply big.Int
|
||||
)
|
||||
|
||||
err := c.provider.EthClient.CallCtx(
|
||||
@ -29,17 +27,15 @@ func (c *CicNet) ERC20TokenInfo(ctx context.Context, tokenAddress common.Address
|
||||
eth.CallFunc(w3.MustNewFunc("name()", "string"), tokenAddress).Returns(&tokenName),
|
||||
eth.CallFunc(w3.MustNewFunc("symbol()", "string"), tokenAddress).Returns(&tokenSymbol),
|
||||
eth.CallFunc(w3.MustNewFunc("decimals()", "uint256"), tokenAddress).Returns(&tokenDecimals),
|
||||
eth.CallFunc(w3.MustNewFunc("totalSupply()", "uint256"), tokenAddress).Returns(&totalSupply),
|
||||
)
|
||||
if err != nil {
|
||||
return ERC20Token{}, err
|
||||
}
|
||||
|
||||
return ERC20Token{
|
||||
Name: tokenName,
|
||||
Symbol: tokenSymbol,
|
||||
Decimals: tokenDecimals,
|
||||
TotalSupply: totalSupply,
|
||||
Name: tokenName,
|
||||
Symbol: tokenSymbol,
|
||||
Decimals: tokenDecimals,
|
||||
}, nil
|
||||
}
|
||||
func (c *CicNet) BalanceOf(ctx context.Context, tokenAddress common.Address, accountAddress common.Address) (big.Int, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user