MCPcopy Create free account
hub / github.com/DNAProject/DNA / GetAllowance

Function GetAllowance

http/base/common/common.go:292–305  ·  view source on GitHub ↗
(asset string, from, to common.Address)

Source from the content-addressed store, hash-verified

290}
291
292func GetAllowance(asset string, from, to common.Address) (string, error) {
293 var contractAddr common.Address
294 switch strings.ToLower(asset) {
295 case "gas":
296 contractAddr = utils.GasContractAddress
297 default:
298 return "", fmt.Errorf("unsupport asset")
299 }
300 allowance, err := GetContractAllowance(0, contractAddr, from, to)
301 if err != nil {
302 return "", fmt.Errorf("get allowance error:%s", err)
303 }
304 return fmt.Sprintf("%v", allowance), nil
305}
306
307func GetContractBalance(cVersion byte, contractAddres []common.Address, accAddr common.Address, atomic bool) ([]uint64, uint32, error) {
308 txes := make([]*types.Transaction, 0, len(contractAddres))

Callers

nothing calls this directly

Calls 2

GetContractAllowanceFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected