From c1bd82aa534dd007f4ad45637f56604abeb56243 Mon Sep 17 00:00:00 2001 From: HFazelinia Date: Thu, 4 Jul 2024 09:44:33 +0100 Subject: [PATCH 01/15] implement Emission contract --- src/main/scala/rosen/bridge/Contracts.scala | 13 + .../scala/rosen/bridge/scripts/Emission.es | 42 +++ src/test/scala/contracts/ContractTest.scala | 262 ++++++++++++++++++ src/test/scala/testUtils/Boxes.scala | 9 + 4 files changed, 326 insertions(+) create mode 100644 src/main/scala/rosen/bridge/scripts/Emission.es diff --git a/src/main/scala/rosen/bridge/Contracts.scala b/src/main/scala/rosen/bridge/Contracts.scala index 64b6078..e28d97d 100644 --- a/src/main/scala/rosen/bridge/Contracts.scala +++ b/src/main/scala/rosen/bridge/Contracts.scala @@ -18,6 +18,7 @@ class Contracts(networkGeneral: NetworkGeneral, networkConfig: Network) { lazy val Lock: (ErgoContract, String) = generateLockContract() lazy val GuardSign: (ErgoContract, String) = generateGuardSignContract() lazy val RepoConfig: (ErgoContract, String) = generateRepoConfigContract() + lazy val Emission: (ErgoContract, String) = generateEmissionContract() def readScript(path: String) = { val scriptSource: BufferedSource = Source.fromFile("src/main/scala/rosen/bridge/scripts/" + path, "utf-8") @@ -177,4 +178,16 @@ class Contracts(networkGeneral: NetworkGeneral, networkConfig: Network) { (contract, address) }) } + + private def generateEmissionContract(): (ErgoContract, String) = { + networkGeneral.ergoNetwork.ergoClient.execute(ctx => { + val emissionScript = readScript("Emission.es") + .replace("GUARD_NFT", Base64.encode(Base16.decode(networkGeneral.mainTokens.GuardNFT).get)) + + val contract = ctx.compileContract(ConstantsBuilder.create().build(), emissionScript) + val address = Utils.getContractAddress(contract, networkGeneral.ergoNetwork.addressEncoder) + println(s"emission address is : \t\t\t$address") + (contract, address) + }) + } } diff --git a/src/main/scala/rosen/bridge/scripts/Emission.es b/src/main/scala/rosen/bridge/scripts/Emission.es new file mode 100644 index 0000000..b65b757 --- /dev/null +++ b/src/main/scala/rosen/bridge/scripts/Emission.es @@ -0,0 +1,42 @@ +{ + // ----------------- REGISTERS + // ----------------- TOKENS + // 0: RSN + // 1: EmittedRSN + + val GuardNFT = fromBase64("GUARD_NFT"); + + if (CONTEXT.dataInputs.size > 0) { + // Emission Box Update transaction + val GuardBox = CONTEXT.dataInputs(0); + val verifyGuard = GuardBox.tokens.exists { (token: (Coll[Byte], Long)) => token._1 == GuardNFT }; + val updateSignCount = GuardBox.R5[Coll[Int]].get(1); + val signedColl = GuardBox.R4[Coll[Coll[Byte]]].get.map { (row: Coll[Byte]) => proveDlog(decodePoint(row)) }; + sigmaProp( + allOf( + Coll( + verifyGuard, + atLeast(updateSignCount, signedColl) + ) + ) + ) + } else { + // Emission transaction + val emissionOut = OUTPUTS(0) + val emission = SELF + sigmaProp( + allOf( + Coll( + emissionOut.propositionBytes == emission.propositionBytes, + emissionOut.value >= emission.value, + emissionOut.tokens.size == emission.tokens.size, + emission.tokens.size >= 2, + emissionOut.tokens(0)._1 == emission.tokens(0)._1, + emissionOut.tokens(1)._1 == emission.tokens(1)._1, + emissionOut.tokens(1)._2 > emission.tokens(1)._2, + emission.tokens(0)._2 - emissionOut.tokens(0)._2 == emissionOut.tokens(1)._2 - emission.tokens(1)._2 + ) + ) + ) + } +} diff --git a/src/test/scala/contracts/ContractTest.scala b/src/test/scala/contracts/ContractTest.scala index f9e3b20..f1bee2c 100644 --- a/src/test/scala/contracts/ContractTest.scala +++ b/src/test/scala/contracts/ContractTest.scala @@ -2048,4 +2048,266 @@ class ContractTest extends TestSuite { } }) } + + /** + * @target redeem emission box transaction should sign successfully + * @dependencies + * @scenario + * - mock emission box + * - mock guards secrets, public keys and box with the guard NFT + * - build and sign the emission redeem transaction + * @expected + * - successful sign for emission redeem transaction + */ + property("redeem emission box transaction should sign successfully") { + networkConfig._1.ergoNetwork.ergoClient.execute(ctx => { + try { + val prover = getProver() + val secrets = (0 until 7).map(ind => Utils.randBigInt.bigInteger) + val guards = secrets.map(item => ctx.newProverBuilder().withDLogSecret(item).build()) + val guardsPks = guards.map(item => item.getAddress.getPublicKey.pkBytes).toArray + val guardBox = Boxes.createGuardNftBox(ctx, guardsPks, 5, 6).convertToInputWith(Boxes.getRandomHexString(), 0) + val ERSNId = Boxes.getRandomHexString() + val emissionBox = Boxes.createEmissionBox( + ctx, + Configs.minBoxValue + Configs.fee, + new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), + new ErgoToken(ERSNId, 9000) + ).convertToInputWith(Boxes.getRandomHexString(), 0) + val inputs = Seq(emissionBox) + val boxBuilder = ctx.newTxBuilder().outBoxBuilder() + .contract(ctx.newContract(prover.getAddress.asP2PK().script)) + .tokens( + new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), + new ErgoToken(ERSNId, 9000) + ) + boxBuilder.value(inputs.map(item => item.getValue).sum - Configs.fee) + val tx = ctx.newTxBuilder().addInputs(emissionBox) + .fee(Configs.fee) + .addDataInputs(guardBox) + .addOutputs(boxBuilder.build()) + .sendChangeTo(prover.getAddress) + .build() + val multiSigProverBuilder = ctx.newProverBuilder() + secrets.map(item => multiSigProverBuilder.withDLogSecret(item)) + val multiSigProver = multiSigProverBuilder.build() + multiSigProver.sign(tx) + } catch { + case exp: Throwable => + println(exp.toString) + fail("transaction not signed") + } + }) + } + + /** + * @target redeem emission box transaction should sign successfully + * @dependencies + * @scenario + * - mock emission box + * - mock guards secrets, public keys and box with the guard NFT + * - build and sign the emission redeem transaction with only 5 secrets + * @expected + * - sign error for emission redeem transaction + */ + property("redeem emission box transaction signing should throw error when signed by less than required guards") { + networkConfig._1.ergoNetwork.ergoClient.execute(ctx => { + try { + val prover = getProver() + val secrets = (0 until 7).map(ind => Utils.randBigInt.bigInteger) + val guards = secrets.map(item => ctx.newProverBuilder().withDLogSecret(item).build()) + val guardsPks = guards.map(item => item.getAddress.getPublicKey.pkBytes).toArray + val guardBox = Boxes.createGuardNftBox(ctx, guardsPks, 5, 6).convertToInputWith(Boxes.getRandomHexString(), 0) + val ERSNId = Boxes.getRandomHexString() + val emissionBox = Boxes.createEmissionBox( + ctx, + Configs.minBoxValue + Configs.fee, + new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), + new ErgoToken(ERSNId, 9000) + ).convertToInputWith(Boxes.getRandomHexString(), 0) + val inputs = Seq(emissionBox) + val boxBuilder = ctx.newTxBuilder().outBoxBuilder() + .contract(ctx.newContract(prover.getAddress.asP2PK().script)) + .tokens( + new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), + new ErgoToken(ERSNId, 9000) + ) + boxBuilder.value(inputs.map(item => item.getValue).sum - Configs.fee) + val tx = ctx.newTxBuilder().addInputs(emissionBox) + .fee(Configs.fee) + .addDataInputs(guardBox) + .addOutputs(boxBuilder.build()) + .sendChangeTo(prover.getAddress) + .build() + val multiSigProverBuilder = ctx.newProverBuilder() + secrets.slice(0, 5).map(item => multiSigProverBuilder.withDLogSecret(item)) + val multiSigProver = multiSigProverBuilder.build() + assertThrows[AnyRef] { + multiSigProver.sign(tx) + } + } catch { + case exp: Throwable => + println(exp.toString) + fail("unexpected error") + } + }) + } + + /** + * @target emission transaction should sign successfully + * @dependencies + * @scenario + * - mock user input + * - mock valid emission box + * - mock valid output emission and user boxes + * - build and sign the emission transaction + * @expected + * - successful sign for emission transaction + */ + property("emission transaction should sign successfully") { + networkConfig._1.ergoNetwork.ergoClient.execute(ctx => { + try { + val prover = getProver() + val ERSNId = Boxes.getRandomHexString() + val userBox = Boxes.createBoxForUser(ctx, prover.getAddress, 1e9.toLong, new ErgoToken(ERSNId, 100L)) + val emissionBox = Boxes.createEmissionBox( + ctx, + Configs.minBoxValue, + new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), + new ErgoToken(ERSNId, 9000) + ).convertToInputWith(Boxes.getRandomHexString(), 0) + + val emissionOut = ctx.newTxBuilder().outBoxBuilder() + .contract(contracts.Emission._1) + .value(Configs.minBoxValue) + .tokens( + new ErgoToken(networkConfig._1.mainTokens.RSN, 9900), + new ErgoToken(ERSNId, 9100) + ).build() + val userOut = ctx.newTxBuilder().outBoxBuilder() + .contract(ctx.newContract(prover.getAddress.asP2PK().script)) + .value(userBox.getValue() - Configs.fee) + .tokens( + new ErgoToken(networkConfig._1.mainTokens.RSN, 100), + ).build() + val tx = ctx.newTxBuilder().addInputs(emissionBox, userBox) + .fee(Configs.fee) + .addOutputs(emissionOut, userOut) + .sendChangeTo(prover.getAddress) + .build() + prover.sign(tx) + } catch { + case exp: Throwable => + println(exp.toString) + fail("transaction not signed") + } + }) + } + + /** + * @target emission transaction signing should throw error when out RSN is more than in ERSN + * @dependencies + * @scenario + * - mock user input + * - mock valid emission box + * - mock valid output emission and user boxes with more RSN + * - build and sign the emission transaction + * @expected + * - sign error for emission transaction + */ + property("emission transaction signing should throw error when out RSN is more than in ERSN") { + networkConfig._1.ergoNetwork.ergoClient.execute(ctx => { + try { + val prover = getProver() + val ERSNId = Boxes.getRandomHexString() + val userBox = Boxes.createBoxForUser(ctx, prover.getAddress, 1e9.toLong, new ErgoToken(ERSNId, 100L)) + val emissionBox = Boxes.createEmissionBox( + ctx, + Configs.minBoxValue, + new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), + new ErgoToken(ERSNId, 9000) + ).convertToInputWith(Boxes.getRandomHexString(), 0) + + val emissionOut = ctx.newTxBuilder().outBoxBuilder() + .contract(contracts.Emission._1) + .value(Configs.minBoxValue) + .tokens( + new ErgoToken(networkConfig._1.mainTokens.RSN, 9800), + new ErgoToken(ERSNId, 9100) + ).build() + val userOut = ctx.newTxBuilder().outBoxBuilder() + .contract(ctx.newContract(prover.getAddress.asP2PK().script)) + .value(userBox.getValue() - Configs.fee) + .tokens( + new ErgoToken(networkConfig._1.mainTokens.RSN, 200), + ).build() + val tx = ctx.newTxBuilder().addInputs(emissionBox, userBox) + .fee(Configs.fee) + .addOutputs(emissionOut, userOut) + .sendChangeTo(prover.getAddress) + .build() + assertThrows[AnyRef] { + prover.sign(tx) + } + } catch { + case exp: Throwable => + println(exp.toString) + fail("unexpected error") + } + }) + } + + /** + * @target emission transaction signing should throw error when RSN is swapped for ERSN + * @dependencies + * @scenario + * - mock user input with RSN + * - mock valid emission box + * - mock valid output emission and user boxes + * - build and sign the emission transaction + * @expected + * - sign error for emission transaction + */ + property("emission transaction signing should throw error when RSN is swapped for ERSN") { + networkConfig._1.ergoNetwork.ergoClient.execute(ctx => { + try { + val prover = getProver() + val ERSNId = Boxes.getRandomHexString() + val userBox = Boxes.createBoxForUser(ctx, prover.getAddress, 1e9.toLong, new ErgoToken(networkConfig._1.mainTokens.RSN, 100L)) + val emissionBox = Boxes.createEmissionBox( + ctx, + Configs.minBoxValue, + new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), + new ErgoToken(ERSNId, 9000) + ).convertToInputWith(Boxes.getRandomHexString(), 0) + + val emissionOut = ctx.newTxBuilder().outBoxBuilder() + .contract(contracts.Emission._1) + .value(Configs.minBoxValue) + .tokens( + new ErgoToken(networkConfig._1.mainTokens.RSN, 10100), + new ErgoToken(ERSNId, 8900) + ).build() + val userOut = ctx.newTxBuilder().outBoxBuilder() + .contract(ctx.newContract(prover.getAddress.asP2PK().script)) + .value(userBox.getValue() - Configs.fee) + .tokens( + new ErgoToken(ERSNId, 100), + ).build() + val tx = ctx.newTxBuilder().addInputs(emissionBox, userBox) + .fee(Configs.fee) + .addOutputs(emissionOut, userOut) + .sendChangeTo(prover.getAddress) + .build() + assertThrows[AnyRef] { + prover.sign(tx) + } + } catch { + case exp: Throwable => + println(exp.toString) + fail("unexpected error") + } + }) + } + } diff --git a/src/test/scala/testUtils/Boxes.scala b/src/test/scala/testUtils/Boxes.scala index cec1d0c..9736cd1 100644 --- a/src/test/scala/testUtils/Boxes.scala +++ b/src/test/scala/testUtils/Boxes.scala @@ -393,4 +393,13 @@ object Boxes { tokens } + def createEmissionBox(ctx: BlockchainContext, amount: Long, tokens: ErgoToken*): OutBox = { + val txb = ctx.newTxBuilder() + txb.outBoxBuilder() + .value(amount) + .tokens(tokens: _*) + .contract(contracts.Emission._1) + .build() + } + } From 4631a570ee861bf801b8ffac1add504e383a983c Mon Sep 17 00:00:00 2001 From: HFazelinia Date: Thu, 4 Jul 2024 11:21:17 +0100 Subject: [PATCH 02/15] add EmissionNFT --- src/main/resources/application.conf | 2 ++ src/main/scala/helpers/Configs.scala | 3 ++- src/main/scala/helpers/Models.scala | 5 +++-- src/main/scala/rosen/bridge/Contracts.scala | 2 ++ src/main/scala/rosen/bridge/scripts/Emission.es | 14 +++++++++----- src/test/resources/application.conf | 1 + src/test/scala/contracts/ContractTest.scala | 10 ++++++++++ 7 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 8014eb9..43ab53f 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -15,6 +15,7 @@ network-general = { GuardNFT="55bf993b4376ba132264d084f06fe033321ab43c68db1435a0e7e0bf77ddb735" RSN="8b08cdd5449a9592a9e79711d7d79249d7a03c535d17efaee83e216e80a44c4b" RSNRatioNFT="e2ed4d64393222db666f20e67803e9e6fbe6d64531e14ff52ddd95615b0cbf17" + EmissionNFT="e2ed4d64393222db666f20e67803e9e6fbe6d64531e14ff52ddd95615b0cbf17" } ergo-network = { node = "https://node.ergopool.io/" @@ -28,6 +29,7 @@ network-general = { GuardNFT="648e9cf0b39560dd33454bb8e5c5e5bf48f12e161dc7c3112d8edfdb1606c40d" RSN="cdf549fccbb09ab8f38ecbf9a5ed37c926707753adf8fed19b039684a0772bfe", RSNRatioNFT="05690d3e7a8daae13495b32af8ab58aaec8a5435f5974f6adf17095d28cac1f5" + EmissionNFT="05690d3e7a8daae13495b32af8ab58aaec8a5435f5974f6adf17095d28cac1f5" } ergo-network = { node = "https://node.ergopool.io/" diff --git a/src/main/scala/helpers/Configs.scala b/src/main/scala/helpers/Configs.scala index 95d7ca1..7ac7b89 100644 --- a/src/main/scala/helpers/Configs.scala +++ b/src/main/scala/helpers/Configs.scala @@ -87,7 +87,8 @@ object Configs extends ConfigHelper { readKeyDynamic(mainTokensConfig, "RepoNFT"), readKeyDynamic(mainTokensConfig, "GuardNFT"), readKeyDynamic(mainTokensConfig, "RSN"), - readKeyDynamic(mainTokensConfig, "RSNRatioNFT") + readKeyDynamic(mainTokensConfig, "RSNRatioNFT"), + readKeyDynamic(mainTokensConfig, "EmissionNFT") ) // Prepare general network config diff --git a/src/main/scala/helpers/Models.scala b/src/main/scala/helpers/Models.scala index 256511c..228ad43 100644 --- a/src/main/scala/helpers/Models.scala +++ b/src/main/scala/helpers/Models.scala @@ -4,13 +4,14 @@ import io.circe.Json import org.ergoplatform.ErgoAddressEncoder import org.ergoplatform.appkit.ErgoClient -case class MainTokens(RepoNFT: String, GuardNFT: String, RSN: String, RSNRatioNFT: String) { +case class MainTokens(RepoNFT: String, GuardNFT: String, RSN: String, RSNRatioNFT: String, EmissionNFT: String) { def toJson(): Json = { Json.fromFields(List( ("RepoNFT", Json.fromString(RepoNFT)), ("GuardNFT", Json.fromString(GuardNFT)), ("RSN", Json.fromString(RSN)), - ("RSNRatioNFT", Json.fromString(RSNRatioNFT)) + ("RSNRatioNFT", Json.fromString(RSNRatioNFT)), + ("EmissionNFT", Json.fromString(EmissionNFT)) )) } } diff --git a/src/main/scala/rosen/bridge/Contracts.scala b/src/main/scala/rosen/bridge/Contracts.scala index e28d97d..f81a572 100644 --- a/src/main/scala/rosen/bridge/Contracts.scala +++ b/src/main/scala/rosen/bridge/Contracts.scala @@ -40,6 +40,7 @@ class Contracts(networkGeneral: NetworkGeneral, networkConfig: Network) { ("WatcherTriggerEvent", Json.fromString(WatcherTriggerEvent._2)), ("WatcherCollateral", Json.fromString(WatcherCollateral._2)), ("RepoConfig", Json.fromString(RepoConfig._2)), + ("Emission", Json.fromString(Emission._2)), )) } @@ -182,6 +183,7 @@ class Contracts(networkGeneral: NetworkGeneral, networkConfig: Network) { private def generateEmissionContract(): (ErgoContract, String) = { networkGeneral.ergoNetwork.ergoClient.execute(ctx => { val emissionScript = readScript("Emission.es") + .replace("EMISSION_NFT", Base64.encode(Base16.decode(networkGeneral.mainTokens.EmissionNFT).get)) .replace("GUARD_NFT", Base64.encode(Base16.decode(networkGeneral.mainTokens.GuardNFT).get)) val contract = ctx.compileContract(ConstantsBuilder.create().build(), emissionScript) diff --git a/src/main/scala/rosen/bridge/scripts/Emission.es b/src/main/scala/rosen/bridge/scripts/Emission.es index b65b757..71ae7f2 100644 --- a/src/main/scala/rosen/bridge/scripts/Emission.es +++ b/src/main/scala/rosen/bridge/scripts/Emission.es @@ -1,9 +1,11 @@ { // ----------------- REGISTERS // ----------------- TOKENS - // 0: RSN - // 1: EmittedRSN + // 0: EmissionNFT + // 1: RSN + // 2: EmittedRSN + val EmissionNFT = fromBase64("EMISSION_NFT"); val GuardNFT = fromBase64("GUARD_NFT"); if (CONTEXT.dataInputs.size > 0) { @@ -30,11 +32,13 @@ emissionOut.propositionBytes == emission.propositionBytes, emissionOut.value >= emission.value, emissionOut.tokens.size == emission.tokens.size, - emission.tokens.size >= 2, + emission.tokens.size == 3, emissionOut.tokens(0)._1 == emission.tokens(0)._1, + emissionOut.tokens(0)._2 == emission.tokens(0)._2, emissionOut.tokens(1)._1 == emission.tokens(1)._1, - emissionOut.tokens(1)._2 > emission.tokens(1)._2, - emission.tokens(0)._2 - emissionOut.tokens(0)._2 == emissionOut.tokens(1)._2 - emission.tokens(1)._2 + emissionOut.tokens(2)._1 == emission.tokens(2)._1, + emissionOut.tokens(2)._2 > emission.tokens(2)._2, + emission.tokens(1)._2 - emissionOut.tokens(1)._2 == emissionOut.tokens(2)._2 - emission.tokens(2)._2 ) ) ) diff --git a/src/test/resources/application.conf b/src/test/resources/application.conf index e3edb97..c1bc3ab 100644 --- a/src/test/resources/application.conf +++ b/src/test/resources/application.conf @@ -12,6 +12,7 @@ network-general = { RepoNFT="2222222222222222222222222222222222222222222222222222222222222222" GuardNFT="3333333333333333333333333333333333333333333333333333333333333333" RSN="1111111111111111111111111111111111111111111111111111111111111111" + EmissionNFT="8888888888888888888888888888888888888888888888888888888888888888" } ergo-network = { node = "https://node.ergopool.io/" diff --git a/src/test/scala/contracts/ContractTest.scala b/src/test/scala/contracts/ContractTest.scala index f1bee2c..fda4ccf 100644 --- a/src/test/scala/contracts/ContractTest.scala +++ b/src/test/scala/contracts/ContractTest.scala @@ -2071,6 +2071,7 @@ class ContractTest extends TestSuite { val emissionBox = Boxes.createEmissionBox( ctx, Configs.minBoxValue + Configs.fee, + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), new ErgoToken(ERSNId, 9000) ).convertToInputWith(Boxes.getRandomHexString(), 0) @@ -2078,6 +2079,7 @@ class ContractTest extends TestSuite { val boxBuilder = ctx.newTxBuilder().outBoxBuilder() .contract(ctx.newContract(prover.getAddress.asP2PK().script)) .tokens( + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), new ErgoToken(ERSNId, 9000) ) @@ -2122,6 +2124,7 @@ class ContractTest extends TestSuite { val emissionBox = Boxes.createEmissionBox( ctx, Configs.minBoxValue + Configs.fee, + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), new ErgoToken(ERSNId, 9000) ).convertToInputWith(Boxes.getRandomHexString(), 0) @@ -2129,6 +2132,7 @@ class ContractTest extends TestSuite { val boxBuilder = ctx.newTxBuilder().outBoxBuilder() .contract(ctx.newContract(prover.getAddress.asP2PK().script)) .tokens( + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), new ErgoToken(ERSNId, 9000) ) @@ -2173,6 +2177,7 @@ class ContractTest extends TestSuite { val emissionBox = Boxes.createEmissionBox( ctx, Configs.minBoxValue, + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), new ErgoToken(ERSNId, 9000) ).convertToInputWith(Boxes.getRandomHexString(), 0) @@ -2181,6 +2186,7 @@ class ContractTest extends TestSuite { .contract(contracts.Emission._1) .value(Configs.minBoxValue) .tokens( + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 9900), new ErgoToken(ERSNId, 9100) ).build() @@ -2224,6 +2230,7 @@ class ContractTest extends TestSuite { val emissionBox = Boxes.createEmissionBox( ctx, Configs.minBoxValue, + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), new ErgoToken(ERSNId, 9000) ).convertToInputWith(Boxes.getRandomHexString(), 0) @@ -2232,6 +2239,7 @@ class ContractTest extends TestSuite { .contract(contracts.Emission._1) .value(Configs.minBoxValue) .tokens( + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 9800), new ErgoToken(ERSNId, 9100) ).build() @@ -2277,6 +2285,7 @@ class ContractTest extends TestSuite { val emissionBox = Boxes.createEmissionBox( ctx, Configs.minBoxValue, + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 10000), new ErgoToken(ERSNId, 9000) ).convertToInputWith(Boxes.getRandomHexString(), 0) @@ -2285,6 +2294,7 @@ class ContractTest extends TestSuite { .contract(contracts.Emission._1) .value(Configs.minBoxValue) .tokens( + new ErgoToken(networkConfig._1.mainTokens.EmissionNFT, 1), new ErgoToken(networkConfig._1.mainTokens.RSN, 10100), new ErgoToken(ERSNId, 8900) ).build() From eb8172ab89d86e8631983a8d43cead080e77ad88 Mon Sep 17 00:00:00 2001 From: HFazelinia Date: Sat, 6 Jul 2024 14:09:31 +0100 Subject: [PATCH 03/15] prevent burning emissionNFT on redeem transaction --- src/main/scala/rosen/bridge/scripts/Emission.es | 4 +++- src/test/scala/contracts/ContractTest.scala | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/scala/rosen/bridge/scripts/Emission.es b/src/main/scala/rosen/bridge/scripts/Emission.es index 71ae7f2..6474019 100644 --- a/src/main/scala/rosen/bridge/scripts/Emission.es +++ b/src/main/scala/rosen/bridge/scripts/Emission.es @@ -18,7 +18,9 @@ allOf( Coll( verifyGuard, - atLeast(updateSignCount, signedColl) + atLeast(updateSignCount, signedColl), + OUTPUTS(0).tokens(0)._1 == SELF.tokens(0)._1, + OUTPUTS(0).tokens(0)._2 == SELF.tokens(0)._2 ) ) ) diff --git a/src/test/scala/contracts/ContractTest.scala b/src/test/scala/contracts/ContractTest.scala index fda4ccf..21a29d2 100644 --- a/src/test/scala/contracts/ContractTest.scala +++ b/src/test/scala/contracts/ContractTest.scala @@ -2103,7 +2103,7 @@ class ContractTest extends TestSuite { } /** - * @target redeem emission box transaction should sign successfully + * @target redeem emission box transaction signing should throw error when signed by less than required guards * @dependencies * @scenario * - mock emission box From 2520688c7c56cfdfc5988b30131aae148d89db68 Mon Sep 17 00:00:00 2001 From: "fateme.r" Date: Mon, 8 Jul 2024 15:02:49 +0330 Subject: [PATCH 04/15] mint loen emission nft --- src/main/resources/application.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 43ab53f..cf76dc2 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -29,7 +29,7 @@ network-general = { GuardNFT="648e9cf0b39560dd33454bb8e5c5e5bf48f12e161dc7c3112d8edfdb1606c40d" RSN="cdf549fccbb09ab8f38ecbf9a5ed37c926707753adf8fed19b039684a0772bfe", RSNRatioNFT="05690d3e7a8daae13495b32af8ab58aaec8a5435f5974f6adf17095d28cac1f5" - EmissionNFT="05690d3e7a8daae13495b32af8ab58aaec8a5435f5974f6adf17095d28cac1f5" + EmissionNFT="68e0238a06f5c61ab813a1f9f6eb0cdf9d02d2e8fc1dc4165b8ab37c731205a8" } ergo-network = { node = "https://node.ergopool.io/" From c4f6858e101c184210bcdd181ff92b644baac41d Mon Sep 17 00:00:00 2001 From: "fateme.r" Date: Sat, 13 Jul 2024 20:43:32 +0330 Subject: [PATCH 05/15] Add eRSN to main tokens --- src/main/resources/application.conf | 2 ++ src/main/scala/helpers/Configs.scala | 3 ++- src/main/scala/helpers/Models.scala | 5 +++-- src/test/resources/application.conf | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index cf76dc2..88668eb 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -16,6 +16,7 @@ network-general = { RSN="8b08cdd5449a9592a9e79711d7d79249d7a03c535d17efaee83e216e80a44c4b" RSNRatioNFT="e2ed4d64393222db666f20e67803e9e6fbe6d64531e14ff52ddd95615b0cbf17" EmissionNFT="e2ed4d64393222db666f20e67803e9e6fbe6d64531e14ff52ddd95615b0cbf17" + ERSN="e2ed4d64393222db666f20e67803e9e6fbe6d64531e14ff52ddd95615b0cbf17" } ergo-network = { node = "https://node.ergopool.io/" @@ -30,6 +31,7 @@ network-general = { RSN="cdf549fccbb09ab8f38ecbf9a5ed37c926707753adf8fed19b039684a0772bfe", RSNRatioNFT="05690d3e7a8daae13495b32af8ab58aaec8a5435f5974f6adf17095d28cac1f5" EmissionNFT="68e0238a06f5c61ab813a1f9f6eb0cdf9d02d2e8fc1dc4165b8ab37c731205a8" + ERSN="6210a801f4fbe487ca55594b0eaee96b9e440747b84f55d916d9c7dfdae5d622" } ergo-network = { node = "https://node.ergopool.io/" diff --git a/src/main/scala/helpers/Configs.scala b/src/main/scala/helpers/Configs.scala index 7ac7b89..ceab7c1 100644 --- a/src/main/scala/helpers/Configs.scala +++ b/src/main/scala/helpers/Configs.scala @@ -88,7 +88,8 @@ object Configs extends ConfigHelper { readKeyDynamic(mainTokensConfig, "GuardNFT"), readKeyDynamic(mainTokensConfig, "RSN"), readKeyDynamic(mainTokensConfig, "RSNRatioNFT"), - readKeyDynamic(mainTokensConfig, "EmissionNFT") + readKeyDynamic(mainTokensConfig, "EmissionNFT"), + readKeyDynamic(mainTokensConfig, "ERSN") ) // Prepare general network config diff --git a/src/main/scala/helpers/Models.scala b/src/main/scala/helpers/Models.scala index 228ad43..7a40732 100644 --- a/src/main/scala/helpers/Models.scala +++ b/src/main/scala/helpers/Models.scala @@ -4,14 +4,15 @@ import io.circe.Json import org.ergoplatform.ErgoAddressEncoder import org.ergoplatform.appkit.ErgoClient -case class MainTokens(RepoNFT: String, GuardNFT: String, RSN: String, RSNRatioNFT: String, EmissionNFT: String) { +case class MainTokens(RepoNFT: String, GuardNFT: String, RSN: String, RSNRatioNFT: String, EmissionNFT: String, ERSN: String) { def toJson(): Json = { Json.fromFields(List( ("RepoNFT", Json.fromString(RepoNFT)), ("GuardNFT", Json.fromString(GuardNFT)), ("RSN", Json.fromString(RSN)), ("RSNRatioNFT", Json.fromString(RSNRatioNFT)), - ("EmissionNFT", Json.fromString(EmissionNFT)) + ("EmissionNFT", Json.fromString(EmissionNFT)), + ("ERSN", Json.fromString(ERSN)), )) } } diff --git a/src/test/resources/application.conf b/src/test/resources/application.conf index c1bc3ab..43db851 100644 --- a/src/test/resources/application.conf +++ b/src/test/resources/application.conf @@ -13,6 +13,7 @@ network-general = { GuardNFT="3333333333333333333333333333333333333333333333333333333333333333" RSN="1111111111111111111111111111111111111111111111111111111111111111" EmissionNFT="8888888888888888888888888888888888888888888888888888888888888888" + ERSN="9999999999999999999999999999999999999999999999999999999999999999" } ergo-network = { node = "https://node.ergopool.io/" From fc308d36c542957418f26318219718be9828f19f Mon Sep 17 00:00:00 2001 From: mohammad fattahi Date: Tue, 30 Jul 2024 17:34:07 +0330 Subject: [PATCH 06/15] add MdToken and DaToken in tokensMap --- tokensMap/DaToken.mainnet-loen.json | 22 ++++++++++++++++++++++ tokensMap/MdToken.mainnet-loen.json | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tokensMap/DaToken.mainnet-loen.json create mode 100644 tokensMap/MdToken.mainnet-loen.json diff --git a/tokensMap/DaToken.mainnet-loen.json b/tokensMap/DaToken.mainnet-loen.json new file mode 100644 index 0000000..decf7c3 --- /dev/null +++ b/tokensMap/DaToken.mainnet-loen.json @@ -0,0 +1,22 @@ +{ + "ergo": { + "tokenId": "720991d79fd680a2b125a0706453a03ef3404b4bff8a59c1a45e8ba69d1f86a8", + "name": "DaToken-loen", + "decimals": 3, + "metaData": { + "type": "EIP-004", + "residency": "native" + } + }, + "cardano": { + "tokenId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0.72734461546f6b656e2d6c6f656e", + "policyId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0", + "assetName": "72734461546f6b656e2d6c6f656e", + "name": "rsDaToken-loen", + "decimals": 0, + "metaData": { + "type": "CIP26", + "residency": "wrapped" + } + } +} diff --git a/tokensMap/MdToken.mainnet-loen.json b/tokensMap/MdToken.mainnet-loen.json new file mode 100644 index 0000000..2c8cf30 --- /dev/null +++ b/tokensMap/MdToken.mainnet-loen.json @@ -0,0 +1,22 @@ +{ + "ergo": { + "tokenId": "72fe3ee5b95245b59a9056a56408c25ac23590b52322ca9040cc27adfa45105f", + "name": "rsMdToken-loen", + "decimals": 0, + "metaData": { + "type": "EIP-004", + "residency": "wrapped" + } + }, + "cardano": { + "tokenId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0.4d64546f6b656e2d6c6f656e", + "policyId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0", + "assetName": "4d64546f6b656e2d6c6f656e", + "name": "MdToken-loen", + "decimals": 3, + "metaData": { + "type": "CIP26", + "residency": "native" + } + } +} From d003f953df8c8371576f9325e1e70babf265a7a9 Mon Sep 17 00:00:00 2001 From: mohammad fattahi Date: Sun, 11 Aug 2024 09:27:25 +0330 Subject: [PATCH 07/15] add or update some tokens for eth network --- tokensMap/Ada.mainnet-loen.json | 9 ++++++ tokensMap/Erg.mainnet-loen.json | 47 +++++++++++++++++------------ tokensMap/Eth.mainnet-loen.json | 31 +++++++++++++++++++ tokensMap/FERC20.mainnet-loen.json | 32 ++++++++++++++++++++ tokensMap/MdERC20.mainnet-loen.json | 31 +++++++++++++++++++ tokensMap/MdToken.mainnet-loen.json | 9 ++++++ 6 files changed, 140 insertions(+), 19 deletions(-) create mode 100644 tokensMap/Eth.mainnet-loen.json create mode 100644 tokensMap/FERC20.mainnet-loen.json create mode 100644 tokensMap/MdERC20.mainnet-loen.json diff --git a/tokensMap/Ada.mainnet-loen.json b/tokensMap/Ada.mainnet-loen.json index 444e292..36a5ce2 100644 --- a/tokensMap/Ada.mainnet-loen.json +++ b/tokensMap/Ada.mainnet-loen.json @@ -18,5 +18,14 @@ "type": "native", "residency": "native" } + }, + "ethereum": { + "tokenId": "0x67fE80cB2fd26e23A1F6bAeb8Ec20CDdd69308f1", + "name": "rsAda-loen", + "decimals": 6, + "metaData": { + "type": "ERC-20", + "residency": "wrapped" + } } } diff --git a/tokensMap/Erg.mainnet-loen.json b/tokensMap/Erg.mainnet-loen.json index 9a64f57..0910e5d 100644 --- a/tokensMap/Erg.mainnet-loen.json +++ b/tokensMap/Erg.mainnet-loen.json @@ -1,22 +1,31 @@ { - "ergo": { - "tokenId": "erg", - "name": "ERG", - "decimals": 9, - "metaData": { - "type": "native", - "residency": "native" - } - }, - "cardano": { - "tokenId": "fca58ef8ba9ef1961e132b611de2f8abcd2f34831e615a6f80c5bb48.77724552472d6c6f656e", - "policyId": "fca58ef8ba9ef1961e132b611de2f8abcd2f34831e615a6f80c5bb48", - "assetName": "77724552472d6c6f656e", - "name": "wrERG-loen", - "decimals": 9, - "metaData": { - "type": "CIP26", - "residency": "wrapped" - } + "ergo": { + "tokenId": "erg", + "name": "ERG", + "decimals": 9, + "metaData": { + "type": "native", + "residency": "native" + } + }, + "cardano": { + "tokenId": "fca58ef8ba9ef1961e132b611de2f8abcd2f34831e615a6f80c5bb48.77724552472d6c6f656e", + "policyId": "fca58ef8ba9ef1961e132b611de2f8abcd2f34831e615a6f80c5bb48", + "assetName": "77724552472d6c6f656e", + "name": "wrERG-loen", + "decimals": 9, + "metaData": { + "type": "CIP26", + "residency": "wrapped" + } + }, + "ethereum": { + "tokenId": "0x46a700DEeFD4a51C9490fc6f6fcFF46B2e2a7539", + "name": "rsErg-loen", + "decimals": 9, + "metaData": { + "type": "ERC-20", + "residency": "wrapped" } } +} diff --git a/tokensMap/Eth.mainnet-loen.json b/tokensMap/Eth.mainnet-loen.json new file mode 100644 index 0000000..bcc89dd --- /dev/null +++ b/tokensMap/Eth.mainnet-loen.json @@ -0,0 +1,31 @@ +{ + "ergo": { + "tokenId": "6a675f7eed88401791555a861ebf3cd054ac58477b6994a39119de4da56a96fe", + "name": "rsEth-loen", + "decimals": 9, + "metaData": { + "type": "EIP-004", + "residency": "wrapped" + } + }, + "cardano": { + "tokenId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0.72734574682d6c6f656e", + "policyId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0", + "assetName": "72734574682d6c6f656e", + "name": "rsEth-loen", + "decimals": 9, + "metaData": { + "type": "CIP26", + "residency": "wrapped" + } + }, + "ethereum": { + "tokenId": "eth", + "name": "ETH", + "decimals": 18, + "metaData": { + "type": "native", + "residency": "native" + } + } +} diff --git a/tokensMap/FERC20.mainnet-loen.json b/tokensMap/FERC20.mainnet-loen.json new file mode 100644 index 0000000..e82fe36 --- /dev/null +++ b/tokensMap/FERC20.mainnet-loen.json @@ -0,0 +1,32 @@ +{ + "ergo": { + "tokenId": "cd65864b3a64c1daa9b0632a64da2c764500bb08a32085b2cc9cafff27d7a38a", + "name": "rsFERC20-loen", + "decimals": 3, + "metaData": { + "type": "EIP-004", + "residency": "wrapped" + } + }, + "cardano": { + "tokenId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0.72734645524332302d6c6f656e", + "policyId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0", + "assetName": "72734645524332302d6c6f656e", + "name": "rsFERC20-loen ", + "decimals": 3, + "metaData": { + "type": "CIP26", + "residency": "wrapped" + } + }, + "ethereum": { + "tokenId": "0xB15084A7833b1cC1DD535FcF9Bc07CA4Abb89ECd", + "name": "FERC20-loen", + "decimals": 3, + "metaData": { + "type": "ERC-20", + "residency": "native" + } + } +} + diff --git a/tokensMap/MdERC20.mainnet-loen.json b/tokensMap/MdERC20.mainnet-loen.json new file mode 100644 index 0000000..72dee62 --- /dev/null +++ b/tokensMap/MdERC20.mainnet-loen.json @@ -0,0 +1,31 @@ +{ + "ergo": { + "tokenId": "7d6fc24cc6ee64cf00781741c44cf44925e01ad31e265f045adde4ac8cf2cc21", + "name": "rsMdERC20-loen", + "decimals": 6, + "metaData": { + "type": "EIP-004", + "residency": "wrapped" + } + }, + "cardano": { + "tokenId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0.72734d6445524332302d6c6f656e", + "policyId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0", + "assetName": "72734d6445524332302d6c6f656e", + "name": "rsMdERC20-loen ", + "decimals": 3, + "metaData": { + "type": "CIP26", + "residency": "wrapped" + } + }, + "ethereum": { + "tokenId": "0x45D79fFa4717093129ec01a22D6c47a31523daf0", + "name": "MdERC20-loen ", + "decimals": 9, + "metaData": { + "type": "ERC-20", + "residency": "native" + } + } +} diff --git a/tokensMap/MdToken.mainnet-loen.json b/tokensMap/MdToken.mainnet-loen.json index 2c8cf30..7208be9 100644 --- a/tokensMap/MdToken.mainnet-loen.json +++ b/tokensMap/MdToken.mainnet-loen.json @@ -18,5 +18,14 @@ "type": "CIP26", "residency": "native" } + }, + "ethereum": { + "tokenId": "0x897f72F1C0bBBfa8dACbD33836b40861A43Ca9e1", + "name": "rsMdToken-loen ", + "decimals": 3, + "metaData": { + "type": "ERC-20", + "residency": "wrapped" + } } } From 33c87e075eb36a0fb6d9735a8f856219f23a5a05 Mon Sep 17 00:00:00 2001 From: mohammad fattahi Date: Sun, 11 Aug 2024 09:31:45 +0330 Subject: [PATCH 08/15] add eth loen config --- src/main/resources/application.conf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 88668eb..08ac6e7 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -115,4 +115,18 @@ networks = { } idKey = "tokenId" } + ethereum = { + loen = { + tokens = { + RWTId="2a4ed39265dc9454565c681323dcb06a8e46bb52f49c146b2c2f9bfb99c93208" + CleanupNFT="25e2aca04a0c1fde171066468644e710dffe9cdfce48b01c408dd52385df2d14" + AwcNFT="a438fddc6aba3303dbbcdabe8dcc98b3ab3a62b4e4b5e2d4782e0db618f4ec32" + RepoConfigNFT="c4c9b9e27b120d4dc92b177f25583064ca123a90ab8a6fbdd9f389c70e427cda" + } + lock-address="" + cold-address="" + cleanup-confirm = 10 + } + idKey = "tokenId" + } } From b29a19cd634665de286abc162b934d6376a35c30 Mon Sep 17 00:00:00 2001 From: Hadi Fazelinia Date: Sun, 11 Aug 2024 15:37:30 +0000 Subject: [PATCH 09/15] Apply 1 suggestion(s) to 1 file(s) --- src/main/resources/application.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 08ac6e7..58d6cc3 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -123,7 +123,7 @@ networks = { AwcNFT="a438fddc6aba3303dbbcdabe8dcc98b3ab3a62b4e4b5e2d4782e0db618f4ec32" RepoConfigNFT="c4c9b9e27b120d4dc92b177f25583064ca123a90ab8a6fbdd9f389c70e427cda" } - lock-address="" + lock-address="0x8875F643F13309FC624d8090023B9f876DA16B1e" cold-address="" cleanup-confirm = 10 } From 4316850a3d70453f4052fc64ef730a333eede232 Mon Sep 17 00:00:00 2001 From: mohammad fattahi Date: Mon, 12 Aug 2024 17:32:43 +0330 Subject: [PATCH 10/15] lower case address and token eth --- src/main/resources/application.conf | 2 +- tokensMap/Ada.mainnet-loen.json | 2 +- tokensMap/Erg.mainnet-loen.json | 2 +- tokensMap/FERC20.mainnet-loen.json | 2 +- tokensMap/MdERC20.mainnet-loen.json | 2 +- tokensMap/MdToken.mainnet-loen.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 58d6cc3..32d82fc 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -123,7 +123,7 @@ networks = { AwcNFT="a438fddc6aba3303dbbcdabe8dcc98b3ab3a62b4e4b5e2d4782e0db618f4ec32" RepoConfigNFT="c4c9b9e27b120d4dc92b177f25583064ca123a90ab8a6fbdd9f389c70e427cda" } - lock-address="0x8875F643F13309FC624d8090023B9f876DA16B1e" + lock-address="0x8875f643f13309fc624d8090023b9f876da16b1e" cold-address="" cleanup-confirm = 10 } diff --git a/tokensMap/Ada.mainnet-loen.json b/tokensMap/Ada.mainnet-loen.json index 36a5ce2..158c4b5 100644 --- a/tokensMap/Ada.mainnet-loen.json +++ b/tokensMap/Ada.mainnet-loen.json @@ -20,7 +20,7 @@ } }, "ethereum": { - "tokenId": "0x67fE80cB2fd26e23A1F6bAeb8Ec20CDdd69308f1", + "tokenId": "0x67fe80cb2fd26e23a1f6baeb8ec20cddd69308f1", "name": "rsAda-loen", "decimals": 6, "metaData": { diff --git a/tokensMap/Erg.mainnet-loen.json b/tokensMap/Erg.mainnet-loen.json index 0910e5d..c0801d2 100644 --- a/tokensMap/Erg.mainnet-loen.json +++ b/tokensMap/Erg.mainnet-loen.json @@ -20,7 +20,7 @@ } }, "ethereum": { - "tokenId": "0x46a700DEeFD4a51C9490fc6f6fcFF46B2e2a7539", + "tokenId": "0x46a700deefd4a51c9490fc6f6fcff46b2e2a7539", "name": "rsErg-loen", "decimals": 9, "metaData": { diff --git a/tokensMap/FERC20.mainnet-loen.json b/tokensMap/FERC20.mainnet-loen.json index e82fe36..7e88ac3 100644 --- a/tokensMap/FERC20.mainnet-loen.json +++ b/tokensMap/FERC20.mainnet-loen.json @@ -20,7 +20,7 @@ } }, "ethereum": { - "tokenId": "0xB15084A7833b1cC1DD535FcF9Bc07CA4Abb89ECd", + "tokenId": "0xb15084a7833b1cc1dd535fcf9bc07ca4abb89ecd", "name": "FERC20-loen", "decimals": 3, "metaData": { diff --git a/tokensMap/MdERC20.mainnet-loen.json b/tokensMap/MdERC20.mainnet-loen.json index 72dee62..3d7e79c 100644 --- a/tokensMap/MdERC20.mainnet-loen.json +++ b/tokensMap/MdERC20.mainnet-loen.json @@ -20,7 +20,7 @@ } }, "ethereum": { - "tokenId": "0x45D79fFa4717093129ec01a22D6c47a31523daf0", + "tokenId": "0x45d79ffa4717093129ec01a22d6c47a31523daf0", "name": "MdERC20-loen ", "decimals": 9, "metaData": { diff --git a/tokensMap/MdToken.mainnet-loen.json b/tokensMap/MdToken.mainnet-loen.json index 7208be9..1b74255 100644 --- a/tokensMap/MdToken.mainnet-loen.json +++ b/tokensMap/MdToken.mainnet-loen.json @@ -20,7 +20,7 @@ } }, "ethereum": { - "tokenId": "0x897f72F1C0bBBfa8dACbD33836b40861A43Ca9e1", + "tokenId": "0x897f72f1c0bbbfa8dacbd33836b40861a43ca9e1", "name": "rsMdToken-loen ", "decimals": 3, "metaData": { From 4c054ed59a822ace141928f796d34072a0f8d37d Mon Sep 17 00:00:00 2001 From: mohammad fattahi Date: Wed, 28 Aug 2024 23:28:31 +0330 Subject: [PATCH 11/15] add bgToken to tokensMap --- tokensMap/BgToken.mainnet-loen.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tokensMap/BgToken.mainnet-loen.json diff --git a/tokensMap/BgToken.mainnet-loen.json b/tokensMap/BgToken.mainnet-loen.json new file mode 100644 index 0000000..c3a6f5c --- /dev/null +++ b/tokensMap/BgToken.mainnet-loen.json @@ -0,0 +1,22 @@ +{ + "ergo": { + "tokenId": "0a3fc5b8acdadbcf3d708fde8a8389273dcb84afa98885ee8dfa369829125c42", + "name": "BgToken-loen", + "decimals": 9, + "metaData": { + "type": "EIP-004", + "residency": "native" + } + }, + "cardano": { + "tokenId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0.72734267546f6b656e2d6c6f656e", + "policyId": "3122541486c983d637e7ed9330c94e490e1fe4a1758725fab7f6d9e0", + "assetName": "72734267546f6b656e2d6c6f656e", + "name": "rsBgToken-loen ", + "decimals": 8, + "metaData": { + "type": "CIP26", + "residency": "wrapped" + } + } +} From 42f57151650a2b9ed0568e76ff9eeafa6cb8a12d Mon Sep 17 00:00:00 2001 From: vorujack Date: Sat, 31 Aug 2024 11:06:14 +0330 Subject: [PATCH 12/15] add ersn and ersnnft token --- src/main/resources/application.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 32d82fc..cb8fe0a 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -15,8 +15,8 @@ network-general = { GuardNFT="55bf993b4376ba132264d084f06fe033321ab43c68db1435a0e7e0bf77ddb735" RSN="8b08cdd5449a9592a9e79711d7d79249d7a03c535d17efaee83e216e80a44c4b" RSNRatioNFT="e2ed4d64393222db666f20e67803e9e6fbe6d64531e14ff52ddd95615b0cbf17" - EmissionNFT="e2ed4d64393222db666f20e67803e9e6fbe6d64531e14ff52ddd95615b0cbf17" - ERSN="e2ed4d64393222db666f20e67803e9e6fbe6d64531e14ff52ddd95615b0cbf17" + EmissionNFT="c5bf77f7edf6b8e793692f6535c28cf67712a5c2efc014637aedad1321f50eaf" + ERSN="dede2cf5c1a2966453ffec198a9b97b53d281e548903a905519b3525d59cdc3c" } ergo-network = { node = "https://node.ergopool.io/" From 00792ee4949a902462d776328c2afefcac6ace5d Mon Sep 17 00:00:00 2001 From: HFazelinia Date: Sat, 7 Sep 2024 12:35:50 +0330 Subject: [PATCH 13/15] add wrapped BTC on ethereum for Loen --- tokensMap/BTC.mainnet-loen.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tokensMap/BTC.mainnet-loen.json b/tokensMap/BTC.mainnet-loen.json index 6b4e732..3d238ad 100644 --- a/tokensMap/BTC.mainnet-loen.json +++ b/tokensMap/BTC.mainnet-loen.json @@ -27,5 +27,14 @@ "type": "native", "residency": "native" } + }, + "ethereum": { + "tokenId": "0x0347618c0eec9e7a65d87e161673d77b6171f31f", + "name": "rsBTC-loen", + "decimals": 8, + "metaData": { + "type": "ERC-20", + "residency": "wrapped" + } } } From c5a03197c66f8a06d897f924eb7e59c6c0ce9341 Mon Sep 17 00:00:00 2001 From: Moein zargarzadeh Date: Sat, 7 Sep 2024 23:23:54 +0330 Subject: [PATCH 14/15] update version to 3.2.3 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index d4e665b..0d46a63 100644 --- a/build.sbt +++ b/build.sbt @@ -21,7 +21,7 @@ libraryDependencies ++= Seq( name := "contract" ThisBuild / scalaVersion := "2.12.7" -ThisBuild / version := "3.2.2" +ThisBuild / version := "3.2.3" ThisBuild / organization := "rosen.bridge" ThisBuild / organizationName := "rosen-bridge" ThisBuild / publishMavenStyle := true From 9507dcbda44f3cd58f7fbec16bc5eaf78cb07e46 Mon Sep 17 00:00:00 2001 From: Moein zargarzadeh Date: Sat, 7 Sep 2024 23:38:04 +0330 Subject: [PATCH 15/15] update version to 3.3.0 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 0d46a63..f6c8c7b 100644 --- a/build.sbt +++ b/build.sbt @@ -21,7 +21,7 @@ libraryDependencies ++= Seq( name := "contract" ThisBuild / scalaVersion := "2.12.7" -ThisBuild / version := "3.2.3" +ThisBuild / version := "3.3.0" ThisBuild / organization := "rosen.bridge" ThisBuild / organizationName := "rosen-bridge" ThisBuild / publishMavenStyle := true