You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

274 lines
12 KiB

  1. // Code generated - DO NOT EDIT.
  2. // This file is a generated binding and any manual changes will be lost.
  3. package erc20
  4. import (
  5. "math/big"
  6. "strings"
  7. ethereum "github.com/ethereum/go-ethereum"
  8. "github.com/ethereum/go-ethereum/accounts/abi"
  9. "github.com/ethereum/go-ethereum/accounts/abi/bind"
  10. "github.com/ethereum/go-ethereum/common"
  11. "github.com/ethereum/go-ethereum/core/types"
  12. "github.com/ethereum/go-ethereum/event"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var (
  16. _ = big.NewInt
  17. _ = strings.NewReader
  18. _ = ethereum.NotFound
  19. _ = bind.Bind
  20. _ = common.Big1
  21. _ = types.BloomLookup
  22. _ = event.NewSubscription
  23. )
  24. // ERC20ABI is the input ABI used to generate the binding from.
  25. const ERC20ABI = "[{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"
  26. // ERC20FuncSigs maps the 4-byte function signature to its string representation.
  27. var ERC20FuncSigs = map[string]string{
  28. "313ce567": "decimals()",
  29. "06fdde03": "name()",
  30. "95d89b41": "symbol()",
  31. }
  32. // ERC20Bin is the compiled bytecode used for deploying new contracts.
  33. var ERC20Bin = "0x608060405234801561001057600080fd5b50610123806100206000396000f3fe6080604052348015600f57600080fd5b5060043610603c5760003560e01c806306fdde03146041578063313ce5671460b957806395d89b41146041575b600080fd5b604760d5565b6040805160208082528351818301528351919283929083019185019080838360005b83811015607f5781810151838201526020016069565b50505050905090810190601f16801560ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60bf60e8565b6040805160ff9092168252519081900360200190f35b6040518060200160405280600081525081565b60008156fea26469706673582212209717f9f3c7b4f090e7741b44c5cb9425a26b593410462c0f4c2c0c0879db648d64736f6c63430007010033"
  34. // DeployERC20 deploys a new Ethereum contract, binding an instance of ERC20 to it.
  35. func DeployERC20(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ERC20, error) {
  36. parsed, err := abi.JSON(strings.NewReader(ERC20ABI))
  37. if err != nil {
  38. return common.Address{}, nil, nil, err
  39. }
  40. address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC20Bin), backend)
  41. if err != nil {
  42. return common.Address{}, nil, nil, err
  43. }
  44. return address, tx, &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil
  45. }
  46. // ERC20 is an auto generated Go binding around an Ethereum contract.
  47. type ERC20 struct {
  48. ERC20Caller // Read-only binding to the contract
  49. ERC20Transactor // Write-only binding to the contract
  50. ERC20Filterer // Log filterer for contract events
  51. }
  52. // ERC20Caller is an auto generated read-only Go binding around an Ethereum contract.
  53. type ERC20Caller struct {
  54. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  55. }
  56. // ERC20Transactor is an auto generated write-only Go binding around an Ethereum contract.
  57. type ERC20Transactor struct {
  58. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  59. }
  60. // ERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events.
  61. type ERC20Filterer struct {
  62. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  63. }
  64. // ERC20Session is an auto generated Go binding around an Ethereum contract,
  65. // with pre-set call and transact options.
  66. type ERC20Session struct {
  67. Contract *ERC20 // Generic contract binding to set the session for
  68. CallOpts bind.CallOpts // Call options to use throughout this session
  69. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  70. }
  71. // ERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract,
  72. // with pre-set call options.
  73. type ERC20CallerSession struct {
  74. Contract *ERC20Caller // Generic contract caller binding to set the session for
  75. CallOpts bind.CallOpts // Call options to use throughout this session
  76. }
  77. // ERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract,
  78. // with pre-set transact options.
  79. type ERC20TransactorSession struct {
  80. Contract *ERC20Transactor // Generic contract transactor binding to set the session for
  81. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  82. }
  83. // ERC20Raw is an auto generated low-level Go binding around an Ethereum contract.
  84. type ERC20Raw struct {
  85. Contract *ERC20 // Generic contract binding to access the raw methods on
  86. }
  87. // ERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
  88. type ERC20CallerRaw struct {
  89. Contract *ERC20Caller // Generic read-only contract binding to access the raw methods on
  90. }
  91. // ERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
  92. type ERC20TransactorRaw struct {
  93. Contract *ERC20Transactor // Generic write-only contract binding to access the raw methods on
  94. }
  95. // NewERC20 creates a new instance of ERC20, bound to a specific deployed contract.
  96. func NewERC20(address common.Address, backend bind.ContractBackend) (*ERC20, error) {
  97. contract, err := bindERC20(address, backend, backend, backend)
  98. if err != nil {
  99. return nil, err
  100. }
  101. return &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil
  102. }
  103. // NewERC20Caller creates a new read-only instance of ERC20, bound to a specific deployed contract.
  104. func NewERC20Caller(address common.Address, caller bind.ContractCaller) (*ERC20Caller, error) {
  105. contract, err := bindERC20(address, caller, nil, nil)
  106. if err != nil {
  107. return nil, err
  108. }
  109. return &ERC20Caller{contract: contract}, nil
  110. }
  111. // NewERC20Transactor creates a new write-only instance of ERC20, bound to a specific deployed contract.
  112. func NewERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC20Transactor, error) {
  113. contract, err := bindERC20(address, nil, transactor, nil)
  114. if err != nil {
  115. return nil, err
  116. }
  117. return &ERC20Transactor{contract: contract}, nil
  118. }
  119. // NewERC20Filterer creates a new log filterer instance of ERC20, bound to a specific deployed contract.
  120. func NewERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC20Filterer, error) {
  121. contract, err := bindERC20(address, nil, nil, filterer)
  122. if err != nil {
  123. return nil, err
  124. }
  125. return &ERC20Filterer{contract: contract}, nil
  126. }
  127. // bindERC20 binds a generic wrapper to an already deployed contract.
  128. func bindERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
  129. parsed, err := abi.JSON(strings.NewReader(ERC20ABI))
  130. if err != nil {
  131. return nil, err
  132. }
  133. return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
  134. }
  135. // Call invokes the (constant) contract method with params as input values and
  136. // sets the output to result. The result type might be a single field for simple
  137. // returns, a slice of interfaces for anonymous returns and a struct for named
  138. // returns.
  139. func (_ERC20 *ERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  140. return _ERC20.Contract.ERC20Caller.contract.Call(opts, result, method, params...)
  141. }
  142. // Transfer initiates a plain transaction to move funds to the contract, calling
  143. // its default method if one is available.
  144. func (_ERC20 *ERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  145. return _ERC20.Contract.ERC20Transactor.contract.Transfer(opts)
  146. }
  147. // Transact invokes the (paid) contract method with params as input values.
  148. func (_ERC20 *ERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  149. return _ERC20.Contract.ERC20Transactor.contract.Transact(opts, method, params...)
  150. }
  151. // Call invokes the (constant) contract method with params as input values and
  152. // sets the output to result. The result type might be a single field for simple
  153. // returns, a slice of interfaces for anonymous returns and a struct for named
  154. // returns.
  155. func (_ERC20 *ERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  156. return _ERC20.Contract.contract.Call(opts, result, method, params...)
  157. }
  158. // Transfer initiates a plain transaction to move funds to the contract, calling
  159. // its default method if one is available.
  160. func (_ERC20 *ERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  161. return _ERC20.Contract.contract.Transfer(opts)
  162. }
  163. // Transact invokes the (paid) contract method with params as input values.
  164. func (_ERC20 *ERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  165. return _ERC20.Contract.contract.Transact(opts, method, params...)
  166. }
  167. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  168. //
  169. // Solidity: function decimals() view returns(uint8)
  170. func (_ERC20 *ERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
  171. var (
  172. ret0 = new(uint8)
  173. )
  174. out := ret0
  175. err := _ERC20.contract.Call(opts, out, "decimals")
  176. return *ret0, err
  177. }
  178. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  179. //
  180. // Solidity: function decimals() view returns(uint8)
  181. func (_ERC20 *ERC20Session) Decimals() (uint8, error) {
  182. return _ERC20.Contract.Decimals(&_ERC20.CallOpts)
  183. }
  184. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  185. //
  186. // Solidity: function decimals() view returns(uint8)
  187. func (_ERC20 *ERC20CallerSession) Decimals() (uint8, error) {
  188. return _ERC20.Contract.Decimals(&_ERC20.CallOpts)
  189. }
  190. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  191. //
  192. // Solidity: function name() view returns(string)
  193. func (_ERC20 *ERC20Caller) Name(opts *bind.CallOpts) (string, error) {
  194. var (
  195. ret0 = new(string)
  196. )
  197. out := ret0
  198. err := _ERC20.contract.Call(opts, out, "name")
  199. return *ret0, err
  200. }
  201. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  202. //
  203. // Solidity: function name() view returns(string)
  204. func (_ERC20 *ERC20Session) Name() (string, error) {
  205. return _ERC20.Contract.Name(&_ERC20.CallOpts)
  206. }
  207. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  208. //
  209. // Solidity: function name() view returns(string)
  210. func (_ERC20 *ERC20CallerSession) Name() (string, error) {
  211. return _ERC20.Contract.Name(&_ERC20.CallOpts)
  212. }
  213. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  214. //
  215. // Solidity: function symbol() view returns(string)
  216. func (_ERC20 *ERC20Caller) Symbol(opts *bind.CallOpts) (string, error) {
  217. var (
  218. ret0 = new(string)
  219. )
  220. out := ret0
  221. err := _ERC20.contract.Call(opts, out, "symbol")
  222. return *ret0, err
  223. }
  224. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  225. //
  226. // Solidity: function symbol() view returns(string)
  227. func (_ERC20 *ERC20Session) Symbol() (string, error) {
  228. return _ERC20.Contract.Symbol(&_ERC20.CallOpts)
  229. }
  230. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  231. //
  232. // Solidity: function symbol() view returns(string)
  233. func (_ERC20 *ERC20CallerSession) Symbol() (string, error) {
  234. return _ERC20.Contract.Symbol(&_ERC20.CallOpts)
  235. }