コード例 #1
0
    def generate_contract_address(self, stack_data: CreateOpcodeStackData,
                                  call_data: bytes,
                                  computation: ComputationAPI) -> Address:

        computation.state.increment_nonce(computation.msg.storage_address)
        return generate_safe_contract_address(computation.msg.storage_address,
                                              stack_data.salt, call_data)
コード例 #2
0
def test_generate_safe_contract_address(origin, salt, code, expected):
    address = generate_safe_contract_address(
        decode_hex(origin), big_endian_to_int(decode_hex(salt)),
        decode_hex(code))

    assert is_same_address(address, expected)