<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.finmath</groupId>
        <artifactId>finmath-decryption-oracle-parent</artifactId>
        <version>1.2.7</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>finmath-decryption-oracle-encrypted-hashed-execution</artifactId>
    <packaging>jar</packaging>

    <name>Decryption Oracle: Encrypted Hashed Exec (ERC-8087)</name>
    <description>Oracle for encrypted arguments and encrypted/transparent function calls (ERC-8xxx).</description>
    <url>https://finmath.gitlab.io/finmath-decryption-oracle</url>

    <dependencies>
        <!-- reuse shared crypto/web3/config -->
        <dependency>
            <groupId>net.finmath</groupId>
            <artifactId>finmath-decryption-oracle-base</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Spring Boot web + thymeleaf -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

        <!-- Tests -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Executable Spring Boot JAR for the execution oracle operator -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <!-- Solidity profile moved here; paths now under this module -->
    <profiles>
        <profile>
            <id>solidity</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.6.2</version>
                        <executions>
                            <execution>
                                <id>compile-solidity</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>solc</executable>
                                    <arguments>
                                        <argument>--optimize</argument>
                                        <argument>--evm-version</argument>
                                        <argument>paris</argument>
                                        <argument>--abi</argument>
                                        <argument>--bin</argument>
                                        <argument>-o</argument>
                                        <argument>${project.build.directory}/solc</argument>
                                        <argument>${project.basedir}/src/main/solidity/CallDecryptionOracle.sol</argument>
                                        <argument>${project.basedir}/src/main/solidity/CallDecryptionOracleRouter.sol</argument>
                                        <argument>${project.basedir}/src/main/solidity/CallDecryptionOracleDemoContract.sol</argument>
                                        <argument>--overwrite</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <developers>
        <developer>
            <id>fries</id>
            <name>Christian Fries</name>
            <email>email@christian-fries.de</email>
            <url>http://www.christian-fries.de</url>
            <timezone>1</timezone>
        </developer>
    </developers>
</project>
