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

Function NewInvokeTransaction

cmd/utils/gas.go:277–290  ·  view source on GitHub ↗

NewInvokeTransaction return smart contract invoke transaction

(gasPrice, gasLimit uint64, invokeCode []byte)

Source from the content-addressed store, hash-verified

275
276//NewInvokeTransaction return smart contract invoke transaction
277func NewInvokeTransaction(gasPrice, gasLimit uint64, invokeCode []byte) *types.MutableTransaction {
278 invokePayload := &payload.InvokeCode{
279 Code: invokeCode,
280 }
281 tx := &types.MutableTransaction{
282 GasPrice: gasPrice,
283 GasLimit: gasLimit,
284 TxType: types.InvokeNeo,
285 Nonce: rand.Uint32(),
286 Payload: invokePayload,
287 Sigs: make([]types.Sig, 0, 0),
288 }
289 return tx
290}
291
292func SignTransaction(signer *account.Account, tx *types.MutableTransaction) error {
293 if tx.Payer == common.ADDRESS_EMPTY {

Callers 3

ApproveTxFunction · 0.70
TransferTxFunction · 0.70
TransferFromTxFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected