forked from nanmu42/etherscan-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontract.go
More file actions
28 lines (23 loc) · 673 Bytes
/
contract.go
File metadata and controls
28 lines (23 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* Copyright (c) 2018 LI Zhennan
*
* Use of this work is governed by a MIT License.
* You may find a license copy in project root.
*/
package etherscan
// ContractABI gets contract abi for verified contract source codes
func (c *Client) ContractABI(address string) (abi string, err error) {
param := M{
"address": address,
}
err = c.call("contract", "getabi", param, &abi)
return
}
// ContractSource gets contract source code for verified contract source codes
func (c *Client) ContractSource(address string) (source []ContractSource, err error) {
param := M{
"address": address,
}
err = c.call("contract", "getsourcecode", param, &source)
return
}