github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/cli/smartcontract/testdata/gas/gas.go (about)

     1  // Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
     2  
     3  // Package gastoken contains RPC wrappers for GasToken contract.
     4  package gastoken
     5  
     6  import (
     7  	"github.com/nspcc-dev/neo-go/pkg/rpcclient/nep17"
     8  	"github.com/nspcc-dev/neo-go/pkg/util"
     9  )
    10  
    11  // Hash contains contract hash.
    12  var Hash = util.Uint160{0xcf, 0x76, 0xe2, 0x8b, 0xd0, 0x6, 0x2c, 0x4a, 0x47, 0x8e, 0xe3, 0x55, 0x61, 0x1, 0x13, 0x19, 0xf3, 0xcf, 0xa4, 0xd2}
    13  
    14  // Invoker is used by ContractReader to call various safe methods.
    15  type Invoker interface {
    16  	nep17.Invoker
    17  }
    18  
    19  // Actor is used by Contract to call state-changing methods.
    20  type Actor interface {
    21  	Invoker
    22  
    23  	nep17.Actor
    24  }
    25  
    26  // ContractReader implements safe contract methods.
    27  type ContractReader struct {
    28  	nep17.TokenReader
    29  	invoker Invoker
    30  	hash    util.Uint160
    31  }
    32  
    33  // Contract implements all contract methods.
    34  type Contract struct {
    35  	ContractReader
    36  	nep17.TokenWriter
    37  	actor Actor
    38  	hash  util.Uint160
    39  }
    40  
    41  // NewReader creates an instance of ContractReader using Hash and the given Invoker.
    42  func NewReader(invoker Invoker) *ContractReader {
    43  	var hash = Hash
    44  	return &ContractReader{*nep17.NewReader(invoker, hash), invoker, hash}
    45  }
    46  
    47  // New creates an instance of Contract using Hash and the given Actor.
    48  func New(actor Actor) *Contract {
    49  	var hash = Hash
    50  	var nep17t = nep17.New(actor, hash)
    51  	return &Contract{ContractReader{nep17t.TokenReader, actor, hash}, nep17t.TokenWriter, actor, hash}
    52  }