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

Function NewDeployCodeTransaction

cmd/utils/gas.go:748–765  ·  view source on GitHub ↗

NewDeployCodeTransaction return a smart contract deploy transaction instance

(gasPrice, gasLimit uint64, code []byte, vmType payload.VmType,
	cname, cversion, cauthor, cemail, cdesc string)

Source from the content-addressed store, hash-verified

746
747//NewDeployCodeTransaction return a smart contract deploy transaction instance
748func 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.
768func ParseNeoVMContractReturnTypeBool(hexStr string) (bool, error) {

Callers 3

DeployContractFunction · 0.85
PrepareDeployContractFunction · 0.85

Calls 1

NewDeployCodeFunction · 0.92

Tested by 1