def deploy(self, target, overwrite=False):
        '''
        deploy this contract
        :param target:
        :param account:  the account address to use
        :return: address, err
        '''

        name = self.name.replace('<stdin>:', "")
        key = DB.pkey([EZO.DEPLOYED, name, target, self.hash])

        if not target:
            return None, "target network must be set with -t or --target"

        password = os.environ['EZO_PASSWORD'] if 'EZO_PASSWORD' in os.environ else None

        # see if a deployment already exists for this contract on this target
        if not overwrite:
            res, err = self._ezo.db.get(key)
            if err:
                return None, "ERROR: Contract.deployment() {}".format(err)
            if res:
                return None, "deployment on {} already exists for contract {} use '--overwrite' to force".format(target, self.hash)

        account = self._ezo.w3.toChecksumAddress(get_account(self._ezo.config, target))
        self._ezo.w3.eth.accounts[0] = account

        try:
            u_state = self._ezo.w3.personal.unlockAccount(account, password)
        except Exception as e:
            return None, "unable to unlock account for {} using password".format(account)

        try:
            ct = self._ezo.w3.eth.contract(abi=self.abi, bytecode=self.bin)
            gas_estimate = ct.constructor().estimateGas()
            h = {'from': account, 'gas': gas_estimate + 1000}
            tx_hash = ct.constructor().transact(h)
            tx_receipt = self._ezo.w3.eth.waitForTransactionReceipt(tx_hash)
            address = tx_receipt['contractAddress']

        except Exception as e:
            return None, e
#        finally:
#            self._ezo.w3.personal.lockAccount(account)

        d = dict()
        d["contract-name"] = self.name
        d["hash"] = self.hash
        d["tx-hash"] = tx_hash
        d["address"] = address
        d["gas-used"] = tx_receipt["gasUsed"]
        d["target"] = target
        d["timestamp"] = datetime.utcnow()

        # save the deployment information
        try:
            _, err = self._ezo.db.save(key, d, overwrite=overwrite)
            if err:
                return None, err
        except Exception as e:
            return None, e

        return address, None
def deploy ( self , target , overwrite = False ) : name = self . name . replace ( '<stdin>:' , "" ) key = DB . pkey ( [ EZO . DEPLOYED , name , target , self . hash ] ) if not target : return None , "target network must be set with -t or --target" password = os . environ [ 'EZO_PASSWORD' ] if 'EZO_PASSWORD' in os . environ else None if not overwrite : res , err = self . _ezo . db . get ( key ) if err : return None , "ERROR: Contract.deployment() {}" . format ( err ) if res : return None , "deployment on {} already exists for contract {} use '--overwrite' to force" . format ( target , self . hash ) account = self . _ezo . w3 . toChecksumAddress ( get_account ( self . _ezo . config , target ) ) self . _ezo . w3 . eth . accounts [ 0 ] = account try : u_state = self . _ezo . w3 . personal . unlockAccount ( account , password ) except Exception as e : return None , "unable to unlock account for {} using password" . format ( account ) try : ct = self . _ezo . w3 . eth . contract ( abi = self . abi , bytecode = self . bin ) gas_estimate = ct . constructor ( ) . estimateGas ( ) h = { 'from' : account , 'gas' : gas_estimate + 1000 } tx_hash = ct . constructor ( ) . transact ( h ) tx_receipt = self . _ezo . w3 . eth . waitForTransactionReceipt ( tx_hash ) address = tx_receipt [ 'contractAddress' ] except Exception as e : return None , e d = dict ( ) d [ "contract-name" ] = self . name d [ "hash" ] = self . hash d [ "tx-hash" ] = tx_hash d [ "address" ] = address d [ "gas-used" ] = tx_receipt [ "gasUsed" ] d [ "target" ] = target d [ "timestamp" ] = datetime . utcnow ( ) try : _ , err = self . _ezo . db . save ( key , d , overwrite = overwrite ) if err : return None , err except Exception as e : return None , e return address , None
deploy this contract
        :param target:
        :param account:  the account address to use
        :return: address, err