NewDeployCodeTransaction return a smart contract deploy transaction instance
(gasPrice, gasLimit uint64, code []byte, vmType payload.VmType, cname, cversion, cauthor, cemail, cdesc string)
| 746 | |
| 747 | //NewDeployCodeTransaction return a smart contract deploy transaction instance |
| 748 | func NewDeployCodeTransaction(gasPrice, gasLimit uint64, code []byte, vmType payload.VmType, |
| 749 | cname, cversion, cauthor, cemail, cdesc string) (*types.MutableTransaction, error) { |
| 750 | |
| 751 | deployPayload, err := payload.NewDeployCode(code, vmType, cname, cversion, cauthor, cemail, cdesc) |
| 752 | if err != nil { |
| 753 | return nil, err |
| 754 | } |
| 755 | tx := &types.MutableTransaction{ |
| 756 | Version: VERSION_TRANSACTION, |
| 757 | TxType: types.Deploy, |
| 758 | Nonce: uint32(time.Now().Unix()), |
| 759 | Payload: deployPayload, |
| 760 | GasPrice: gasPrice, |
| 761 | GasLimit: gasLimit, |
| 762 | Sigs: make([]types.Sig, 0, 0), |
| 763 | } |
| 764 | return tx, nil |
| 765 | } |
| 766 | |
| 767 | //ParseNeoVMContractReturnTypeBool return bool value of smart contract execute code. |
| 768 | func ParseNeoVMContractReturnTypeBool(hexStr string) (bool, error) { |