def withdraw_token(tx):
    tmp = basic(tx)
    tmp["type"] = "ed_withdraw"
    tmp["erc20_value"] = get_value_from_input(tx["input"])
    tmp["erc20_to"] = tmp["tx_from"]
    tmp["tx_from"] = tmp["tx_to"]
    return tmp
Exemplo n.º 2
0
    def sweep(self, tx):
        tmp = self.basic_preparation(tx)
        tmp["type"] = "sweep"
        tmp["tx_to"] = get_to_addr_from_input(tx["input"])
        tmp["erc20_value"] = get_value_from_input(tx["input"])
        logs = get_logs_from_receipt(self.TRANSACTION_RECEIPT)
        if logs:

            topics = ["0", "0", "0"]
            for each_log in logs:
                if len(each_log['topics']) == 4:
                    topics = each_log["topics"]

            if topics[1] == "0":
                print "\ttopic not valid for sweep"
            tmp["tx_from"] = "0x" + topics[1].strip("0").strip("0x")
            tmp["erc20_to"] = "0x" + topics[2].strip("0").strip("0x")
        return tmp
Exemplo n.º 3
0
 def angel(self, tx):
     tmp = self.basic_preparation(tx)
     tmp["type"] = "angel"
     tmp["eth_value"] = get_value_from_input(tx["input"])
     return tmp
def deposit_token(tx):
    tmp = basic(tx)
    tmp["type"] = "ed_deposit"
    tmp["erc20_value"] = get_value_from_input(tx["input"])
    tmp["erc20_to"] = tmp["tx_to"]
    return tmp
Exemplo n.º 5
0
 def approve_method(self, tx):
     tmp = self.basic_preparation(tx)
     tmp["type"] = "approve"
     tmp["erc20_value"] = get_value_from_input(tx["input"])
     return tmp