From ba863089d3754649368578884672a18fb5bc3893 Mon Sep 17 00:00:00 2001 From: Moein zargarzadeh Date: Tue, 2 Jul 2024 11:20:42 +0330 Subject: [PATCH] add coldAddress to contract files --- build.sbt | 2 +- src/main/resources/application.conf | 6 ++++++ src/main/scala/helpers/Configs.scala | 2 ++ src/main/scala/helpers/Models.scala | 2 +- src/main/scala/rosen/bridge/Contracts.scala | 1 + 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index dbab5f8..d4e665b 100644 --- a/build.sbt +++ b/build.sbt @@ -21,7 +21,7 @@ libraryDependencies ++= Seq( name := "contract" ThisBuild / scalaVersion := "2.12.7" -ThisBuild / version := "3.2.1" +ThisBuild / version := "3.2.2" ThisBuild / organization := "rosen.bridge" ThisBuild / organizationName := "rosen-bridge" ThisBuild / publishMavenStyle := true diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index fdef0fe..8014eb9 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -47,6 +47,7 @@ networks = { RepoConfigNFT="37aa6c6c414a85912b373ca9a3abe88a29b9c738a9c1b2bf8644c19dedc09ce0" } lock-address="addr1v8kqhz5lkdxqm8qtkn4lgd9f4890v0j6advjfmk5k9amu4c535lsu" + cold-address="addr1x8x6ca648w25x085dg8xs6k5e69yemr5hakcnl0gshmal6gahwzvy33q3jhr74lurpr9p0n8derw58fh7snq2zwxe8zsdkcqrj" cleanup-confirm=21600 } loen = { @@ -57,6 +58,7 @@ networks = { RepoConfigNFT="abde6d2b51f6e8b85f3040ecccb3087531f0773a6a1d3faaeef043e10390f3eb" } lock-address = "addr1v9kmp9flrq8gzh287q4kku8vmad3vkrw0rwqvjas6vyrf9s9at4dn" + cold-address="" cleanup-confirm = 10 } idKey = "tokenId" @@ -69,6 +71,7 @@ networks = { AwcNFT="c2bdf69d3fd88c3a82149200fe756bffb850c1433ea8473f26664877cc7188b3" RepoConfigNFT="c8dea5bd396984a17fc0aefafb11c46188a9a980caf2af12f7c893508db93a5b" } + cold-address="HNJiaJVyw1qtkiuQYxDTjaA8rmogotVzADinCt5qqavoyoREWM27WAp6f9Y79meFcMoJLt3yr8nsWC5xU5474ojCxE7VweGpd9sLz79VrSiyu7zBjBXPjgGLFZdJAEJhsH8A4y924MVZa7D9te6t3FUiLcpyTbrvTBhD7SpnD6hUjbGszCEGf1fRX1SmWZikeXcJEkfej42dPRimT6Fw423XAc9Tbeih8ZW8x7f5Y7y8frF5kxEdw998JdLU6UzPSwhrDjfKhySqmssQeQxCFwb19PMCB8ZZtx2mGwczr2H12Yi3hnEWn9ArqRqKWip24pJgm6e4Ky7n7BzGRRTmDtcA2EGH3zEVzpRH6aNSHE1MJ51dbCZSNFnRJfk3vxenkSevCfvEMfn5KyQP9wPU5foZACuHX8TQXvVUe1va3HXJFwCm74gxRssBy61GcYdwVbtxykPrw3t6aDX7c46BejsXvEaz5Ydcu7U8MJCoYia9pZ6zkjAj8d7Su12DMK1aLkBxw4vY2zQYc" cleanup-confirm = 21600 } loen = { @@ -78,6 +81,7 @@ networks = { AwcNFT="852ccfce6b0b060f81153cd1994d5f42e5e59d7f092adbadab2b5e1ca2c34b63" RepoConfigNFT="99016d570b66c7188957cb72acbf131ab0be7611e011ba47c783a3c3f5773daf" } + cold-address="" cleanup-confirm = 10 } idKey = "tokenId" @@ -91,6 +95,7 @@ networks = { RepoConfigNFT="92d61d0717853b1b6f85758c5e92c7aa946b24051323c12598df9a53f6684df6" } lock-address="bc1qs0852en99dfctv0egj2qxnmc79mhjgn9ap975t" + cold-address="" cleanup-confirm = 21600 } loen = { @@ -101,6 +106,7 @@ networks = { RepoConfigNFT="1c589bcb108a4408e65ef1d68766b102b7c2dedc11161c618e413225110ffc6a" } lock-address="bc1qt58qyyqw8yezp7g0lnjyshuqnhj07amuerhj93" + cold-address="" cleanup-confirm = 10 } idKey = "tokenId" diff --git a/src/main/scala/helpers/Configs.scala b/src/main/scala/helpers/Configs.scala index 0391b31..95d7ca1 100644 --- a/src/main/scala/helpers/Configs.scala +++ b/src/main/scala/helpers/Configs.scala @@ -65,9 +65,11 @@ object Configs extends ConfigHelper { readKeyDynamic(networkTokensConfig, "RepoConfigNFT"), ) val lockAddress = if (networkName != "ergo") readKeyDynamic(networkDataConfig, "lock-address", "PLEASE SET LOCK_ADDRESS MANUALLY") else "" + val coldAddress = readKeyDynamic(networkDataConfig, "cold-address", "PLEASE SET COLD_ADDRESS MANUALLY") allNetworksToken((networkName, networkType.toString)) = Network( tokens, lockAddress, + coldAddress, readKeyDynamic(networkDataConfig, "cleanup-confirm").toInt ) }) diff --git a/src/main/scala/helpers/Models.scala b/src/main/scala/helpers/Models.scala index 6a597de..256511c 100644 --- a/src/main/scala/helpers/Models.scala +++ b/src/main/scala/helpers/Models.scala @@ -28,6 +28,6 @@ case class Tokens(CleanupNFT: String, RWTId: String, AwcNFT: String, RepoConfigN } } -case class Network(tokens: Tokens, lockAddress: String, cleanupConfirm: Int) +case class Network(tokens: Tokens, lockAddress: String, coldAddress: String, cleanupConfirm: Int) case class NetworkGeneral(ergoNetwork: ErgoNetwork, mainTokens: MainTokens) diff --git a/src/main/scala/rosen/bridge/Contracts.scala b/src/main/scala/rosen/bridge/Contracts.scala index e877ec3..64b6078 100644 --- a/src/main/scala/rosen/bridge/Contracts.scala +++ b/src/main/scala/rosen/bridge/Contracts.scala @@ -33,6 +33,7 @@ class Contracts(networkGeneral: NetworkGeneral, networkConfig: Network) { ("WatcherPermit", Json.fromString(WatcherPermit._2)), ("Fraud", Json.fromString(Fraud._2)), ("lock", Json.fromString(lockAddress)), + ("cold", Json.fromString(networkConfig.coldAddress)), ("guardSign", Json.fromString(GuardSign._2)), ("Commitment", Json.fromString(Commitment._2)), ("WatcherTriggerEvent", Json.fromString(WatcherTriggerEvent._2)),