def decode_owner(self, v: int, r: int, s: int, safe_tx_hash: EthereumBytes): if v == 0: # Contract signature # We don't need further checks contract_address = checksum_encode(r) return contract_address elif v == 1: # Approved hash return checksum_encode(r) elif v > 30: # Support eth_sign # defunct_hash_message preprends `\x19Ethereum Signed Message:\n32` message_hash = defunct_hash_message(primitive=safe_tx_hash) return get_signing_address(message_hash, v - 4, r, s) else: # EOA signature return get_signing_address(safe_tx_hash, v, r, s)
def owner(self): return get_signing_address(self.safe_tx_hash, self.v, self.r, self.s)
def owner(self): # defunct_hash_message prepends `\x19Ethereum Signed Message:\n32` message_hash = defunct_hash_message(primitive=self.safe_tx_hash) return get_signing_address(message_hash, self.v - 4, self.r, self.s)