Compare commits

..

No commits in common. "master" and "v1.4.1" have entirely different histories.

3 changed files with 7 additions and 21 deletions

View File

@ -1,8 +0,0 @@
version = 1
[[analyzers]]
name = "go"
enabled = true
[analyzers.meta]
import_root = "github.com/grassrootseconomics/cic-go"

View File

@ -1,5 +1,3 @@
> DEPRECATED: Use https://github.com/grassrootseconomics/cic-go-sdk
[![Go Reference](https://pkg.go.dev/badge/github.com/grassrootseconomics/cic_go.svg)](https://pkg.go.dev/github.com/grassrootseconomics/cic_go)
[![Go](https://github.com/grassrootseconomics/cic_go/actions/workflows/go.yml/badge.svg)](https://github.com/grassrootseconomics/cic_go/actions/workflows/go.yml)
[![Coverage Status](https://coveralls.io/repos/github/grassrootseconomics/cic_go/badge.svg?branch=sohail/cic_net_updates)](https://coveralls.io/github/grassrootseconomics/cic_go?branch=sohail/cic_net_updates)

View File

@ -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) {