Esempio n. 1
0
def transfercheck(ctx, _acct, _txhash):
    w3 = ctx['web3instance']
    if 'transfercheck' not in ctx['deployedcontracts'][_acct.address].keys():
        try:
            tx_receipt = w3.eth.waitForTransactionReceipt(_txhash, timeout=120)
        except:
            return False
        _from = tx_receipt['from']
        _to = tx_receipt['to']

        if _to != _acct.address:
            return False

        try:
            balance = w3.eth.getBalance(_acct.address)
        except:
            return False

        if balance < MINSTARTBALANCE:
            p.pln(
                p.in_fg_color(
                    "contructor Balance Not Enough, Please Send More ETH...",
                    r.red4))

        update_user_deploy_contracts(ctx, _acct.address, 'transfercheck',
                                     _from)
        return True
    else:
        return True
Esempio n. 2
0
def mint(ctx, _contract, _to_address, _amount, _acct, _acc_nonce):
    if 'mintflagtoken' not in ctx['deployedcontracts'][_acct.address].keys():
        p.ppln("[-] try to mintflagtoken to deployer...")
        err, txhash = mintflagtoken(ctx, _contract, _to_address, _amount,
                                    _acct, _acc_nonce)
        if err:
            p.ppln(p.in_fg_color(("[!] " + str(err)), r.red5))
            exit(0)
        else:
            update_user_deploy_contracts(ctx, _acct.address, 'mintflagtoken',
                                         txhash.hex())
            return None, txhash.hex()
    else:
        txhash = ctx['deployedcontracts'][_acct.address]['mintflagtoken']
        return None, txhash
def review(ctx, _acct, _txhash):
    w3 = ctx['web3instance']
    p.ppln("[-] Check for feitoken contract successful deployment... ")
    if 'feitoken' not in ctx['deployedcontracts'][_acct.address].keys():
        try:
            tx_receipt = w3.eth.waitForTransactionReceipt(_txhash, timeout=720)
        except Exception as err:
            p.p(str(err))
            exit(0)
        addr = tx_receipt['contractAddress']
        update_user_deploy_contracts(ctx, _acct.address, 'feitoken', addr)
    else:
        addr = ctx['deployedcontracts'][_acct.address]['feitoken']

    if not addr:
        p.pln(p.in_fg_color("[!] contract feitoken deploy Broken down", r.red5))
    else:
        p.ppln("[+] contract feitoken deploy " + p.in_fg_color("success", r.green1))
        p.ppln("[!] feitoken contract address is " + p.in_fg_color(addr, r.blue1))
def addliquidity(ctx, _contract, _tokenA, _tokenB, _amountA, _amountB,
                 _to_address, _acct, _acc_nonce):
    if 'addliquiditychaitinrouter' not in ctx['deployedcontracts'][
            _acct.address].keys():
        p.ppln("[-] try to addliquiditychaitinrouter to deployer...")
        err, txhash = addliquiditychaitinrouter(ctx, _contract, _to_address,
                                                _tokenA, _tokenB, _amountA,
                                                _amountB, _acct, _acc_nonce)
        if err:
            p.ppln(p.in_fg_color(("[!] " + str(err)), r.red5))
            exit(0)
        else:
            update_user_deploy_contracts(ctx, _acct.address,
                                         'addliquiditychaitinrouter',
                                         txhash.hex())
            return None, txhash.hex()
    else:
        txhash = ctx['deployedcontracts'][
            _acct.address]['addliquiditychaitinrouter']
        return None, txhash
def allpairs(ctx, _contract, _acct):
    if 'allpairschaitinfactory' not in ctx['deployedcontracts'][
            _acct.address].keys():
        p.ppln("[-] try to allpairschaitinfactory...")
        err, pair_addr = allpairschaitinfactory(ctx, _contract, _acct)
        if err:
            p.ppln(p.in_fg_color(("[!] " + str(err)), r.red5))
            exit(0)
        else:
            update_user_deploy_contracts(ctx, _acct.address,
                                         'allpairschaitinfactory', pair_addr)
            p.ppln("[+] allpairschaitinfactory " +
                   p.in_fg_color("success", r.green1))
            p.ppln("[!] chaitinToken-feiToken pair address is: " +
                   p.in_fg_color(pair_addr, r.blue1))
            return None, pair_addr
    else:
        pair_addr = ctx['deployedcontracts'][
            _acct.address]['allpairschaitinfactory']
        p.ppln("[!] chaitinToken-feiToken pair address is: " +
               p.in_fg_color(pair_addr, r.blue1))
        return None, pair_addr