<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: core/contract/smart_contract.proto

namespace Protocol;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Generated from protobuf message <code>protocol.SmartContract</code>
 */
class SmartContract extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>bytes origin_address = 1;</code>
     */
    protected $origin_address = '';
    /**
     * Generated from protobuf field <code>bytes contract_address = 2;</code>
     */
    protected $contract_address = '';
    /**
     * Generated from protobuf field <code>.protocol.SmartContract.ABI abi = 3;</code>
     */
    protected $abi = null;
    /**
     * Generated from protobuf field <code>bytes bytecode = 4;</code>
     */
    protected $bytecode = '';
    /**
     * Generated from protobuf field <code>int64 call_value = 5;</code>
     */
    protected $call_value = 0;
    /**
     * Generated from protobuf field <code>int64 consume_user_resource_percent = 6;</code>
     */
    protected $consume_user_resource_percent = 0;
    /**
     * Generated from protobuf field <code>string name = 7;</code>
     */
    protected $name = '';
    /**
     * Generated from protobuf field <code>int64 origin_energy_limit = 8;</code>
     */
    protected $origin_energy_limit = 0;
    /**
     * Generated from protobuf field <code>bytes code_hash = 9;</code>
     */
    protected $code_hash = '';
    /**
     * Generated from protobuf field <code>bytes trx_hash = 10;</code>
     */
    protected $trx_hash = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $origin_address
     *     @type string $contract_address
     *     @type \Protocol\SmartContract\ABI $abi
     *     @type string $bytecode
     *     @type int|string $call_value
     *     @type int|string $consume_user_resource_percent
     *     @type string $name
     *     @type int|string $origin_energy_limit
     *     @type string $code_hash
     *     @type string $trx_hash
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Core\Contract\SmartContract::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>bytes origin_address = 1;</code>
     * @return string
     */
    public function getOriginAddress()
    {
        return $this->origin_address;
    }

    /**
     * Generated from protobuf field <code>bytes origin_address = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setOriginAddress($var)
    {
        GPBUtil::checkString($var, False);
        $this->origin_address = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes contract_address = 2;</code>
     * @return string
     */
    public function getContractAddress()
    {
        return $this->contract_address;
    }

    /**
     * Generated from protobuf field <code>bytes contract_address = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setContractAddress($var)
    {
        GPBUtil::checkString($var, False);
        $this->contract_address = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.protocol.SmartContract.ABI abi = 3;</code>
     * @return \Protocol\SmartContract\ABI
     */
    public function getAbi()
    {
        return isset($this->abi) ? $this->abi : null;
    }

    public function hasAbi()
    {
        return isset($this->abi);
    }

    public function clearAbi()
    {
        unset($this->abi);
    }

    /**
     * Generated from protobuf field <code>.protocol.SmartContract.ABI abi = 3;</code>
     * @param \Protocol\SmartContract\ABI $var
     * @return $this
     */
    public function setAbi($var)
    {
        GPBUtil::checkMessage($var, \Protocol\SmartContract\ABI::class);
        $this->abi = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes bytecode = 4;</code>
     * @return string
     */
    public function getBytecode()
    {
        return $this->bytecode;
    }

    /**
     * Generated from protobuf field <code>bytes bytecode = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setBytecode($var)
    {
        GPBUtil::checkString($var, False);
        $this->bytecode = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 call_value = 5;</code>
     * @return int|string
     */
    public function getCallValue()
    {
        return $this->call_value;
    }

    /**
     * Generated from protobuf field <code>int64 call_value = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCallValue($var)
    {
        GPBUtil::checkInt64($var);
        $this->call_value = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 consume_user_resource_percent = 6;</code>
     * @return int|string
     */
    public function getConsumeUserResourcePercent()
    {
        return $this->consume_user_resource_percent;
    }

    /**
     * Generated from protobuf field <code>int64 consume_user_resource_percent = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setConsumeUserResourcePercent($var)
    {
        GPBUtil::checkInt64($var);
        $this->consume_user_resource_percent = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string name = 7;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Generated from protobuf field <code>string name = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 origin_energy_limit = 8;</code>
     * @return int|string
     */
    public function getOriginEnergyLimit()
    {
        return $this->origin_energy_limit;
    }

    /**
     * Generated from protobuf field <code>int64 origin_energy_limit = 8;</code>
     * @param int|string $var
     * @return $this
     */
    public function setOriginEnergyLimit($var)
    {
        GPBUtil::checkInt64($var);
        $this->origin_energy_limit = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes code_hash = 9;</code>
     * @return string
     */
    public function getCodeHash()
    {
        return $this->code_hash;
    }

    /**
     * Generated from protobuf field <code>bytes code_hash = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setCodeHash($var)
    {
        GPBUtil::checkString($var, False);
        $this->code_hash = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes trx_hash = 10;</code>
     * @return string
     */
    public function getTrxHash()
    {
        return $this->trx_hash;
    }

    /**
     * Generated from protobuf field <code>bytes trx_hash = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setTrxHash($var)
    {
        GPBUtil::checkString($var, False);
        $this->trx_hash = $var;

        return $this;
    }

}

