mirror of
https://github.com/grassrootseconomics/cic-go.git
synced 2025-07-06 18:32:48 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
dbcc03d1e8 | |||
|
5d2daa2c8e | ||
2070f9afcd | |||
9a7dc6457e |
8
.deepsource.toml
Normal file
8
.deepsource.toml
Normal file
@ -0,0 +1,8 @@
|
||||
version = 1
|
||||
|
||||
[[analyzers]]
|
||||
name = "go"
|
||||
enabled = true
|
||||
|
||||
[analyzers.meta]
|
||||
import_root = "github.com/grassrootseconomics/cic-go"
|
@ -1,3 +1,5 @@
|
||||
> 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)
|
||||
|
@ -13,6 +13,7 @@ type ERC20Token struct {
|
||||
Name string
|
||||
Symbol string
|
||||
Decimals big.Int
|
||||
TotalSupply big.Int
|
||||
}
|
||||
|
||||
func (c *CicNet) ERC20TokenInfo(ctx context.Context, tokenAddress common.Address) (ERC20Token, error) {
|
||||
@ -20,6 +21,7 @@ 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(
|
||||
@ -27,6 +29,7 @@ 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
|
||||
@ -36,6 +39,7 @@ func (c *CicNet) ERC20TokenInfo(ctx context.Context, tokenAddress common.Address
|
||||
Name: tokenName,
|
||||
Symbol: tokenSymbol,
|
||||
Decimals: tokenDecimals,
|
||||
TotalSupply: totalSupply,
|
||||
}, 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