From 0a360b1680c5f3b4f56bd89dd96335ff5ed91865 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 3 May 2022 14:10:52 +0300 Subject: [PATCH] Deployed one more hermes sc --- README.md | 3 +++ migrations/3_upgrade_consumer_channel.js | 24 ++++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0066cf9..54bf2e8 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,15 @@ Hermes smart contract - V1 on Polygon [0xa62a2A75949d25e17C6F08a7818e7bE97c18a8d2](https://polygonscan.com/address/0xa62a2a75949d25e17c6f08a7818e7be97c18a8d2) - V1 on Ethereum [0xa62a2A75949d25e17C6F08a7818e7bE97c18a8d2](https://etherscan.io/address/0xa62a2A75949d25e17C6F08a7818e7bE97c18a8d2) - V2 on Polygon [0xDe82990405aCc36B4Fd53c94A24D1010fcc1F83d](https://polygonscan.com/address/0xDe82990405aCc36B4Fd53c94A24D1010fcc1F83d) +- V3 on Polygon [0x80ed28d84792d8b153bf2f25f0c4b7a1381de4ab](https://polygonscan.com/address/0x80ed28d84792d8b153bf2f25f0c4b7a1381de4ab) Implementation addresses: - Hermes implementation address (same on both networks): `0x213a1B1d08F2715aE054ade98DEEd8a8F1cc937E` +- Hermes implementation v3 address (Polygon only): `0x4f7265afc1373317975a306023574BE5Ec87157A` - Channel implementation address (Polygon): `0x25882f4966065ca13b7bac15cc48391d9a4124f6` - Channel implementation v2 address (Polygon): `0x813d3A0ef42FD4F25F2854811A64D5842EF3F8D1` +- Channel implementation v3 address (Polygon): `0x6b423D3885B4877b5760E149364f85f185f477aD` - Channel implementation address (Ethereum): `0xBd20839B331A7A8d10e34CDf7219edf334814c4f` ## Testnet3 deployment (ethereum Görli and polygon Mumbai testnets) diff --git a/migrations/3_upgrade_consumer_channel.js b/migrations/3_upgrade_consumer_channel.js index 018f35c..d8a0b93 100644 --- a/migrations/3_upgrade_consumer_channel.js +++ b/migrations/3_upgrade_consumer_channel.js @@ -4,6 +4,7 @@ const MystToken = artifacts.require("MystToken") const Registry = artifacts.require("Registry") const ChannelImplementation = artifacts.require("ChannelImplementation") const HermesImplementation = artifacts.require("HermesImplementation") +const deployRegistry = require("../scripts/deployRegistry") const tokenAddr = { mumbai: '0xB923b52b60E247E34f9afE6B3fa5aCcBAea829E8', @@ -13,20 +14,26 @@ const tokenAddr = { } // Hermes operator is signing hermes payment promises. Change it before actual deployment. -const HERMES_OPERATOR = '0x133cd135ebfaaf074c0068edefb1ca6d22112490' -const MEGA_OWNER = '0xC6b139344239b9E33F8dec27DE5Bd7E2a45F0374' +const HERMES_OPERATOR = '0xbb322f4a93f4001d3f2dd07aa957c3e8361e8976' +const MEGA_OWNER = '0xd1beE7b6C062b01815e7F8934Ce264C1c1cd250d' -const deployNewImplementation = false +const deployNewImplementation = true module.exports = async function (deployer, network, accounts) { const account = accounts[0] if (deployNewImplementation) { - // Deploy Channel implementation into blockchain + // Deploy Channel and Hermes implementations into blockchain await deployer.deploy(ChannelImplementation, { from: account }) + console.log(' :> ChannelImplementation:', ChannelImplementation.address) + + await deployer.deploy(HermesImplementation, { from: account }) + console.log(' :> HermesImplementation:', HermesImplementation.address) const tokenAddress = tokenAddr[network] - const registryAddress = '0x87F0F4b7e0FAb14A565C87BAbbA6c40c92281b51' - const hermesImplementationAddress = '0x213a1B1d08F2715aE054ade98DEEd8a8F1cc937E' + const [registryAddress, _] = await deployRegistry(web3, account) + const channelImplementationAddress = ChannelImplementation.address + const hermesImplementationAddress = HermesImplementation.address + const hermesOperator = HERMES_OPERATOR const token = await MystToken.at(tokenAddress) const registry = await Registry.at(registryAddress) @@ -35,11 +42,12 @@ module.exports = async function (deployer, network, accounts) { await registry.setImplementations(ChannelImplementation.address, hermesImplementationAddress) // Register new hermes - const hermesStake = web3.utils.toWei(new BN('1000'), 'ether') // 1000 tokens + const hermesStake = web3.utils.toWei(new BN('500'), 'ether') // 500 tokens const hermesFee = 2000 // 20.00% const minChannelStake = web3.utils.toWei(new BN('0'), 'ether') // 0 token const maxChannelStake = web3.utils.toWei(new BN('100'), 'ether') // 100 tokens - const url = Buffer.from('68747470733a2f2f6865726d6573322e6d797374657269756d2e6e6574776f726b2f', 'hex') // https://hermes2.mysterium.network/ + const url = Buffer.from('68747470733a2f2f6865726d6573332e6d797374657269756d2e6e6574776f726b2f', 'hex') // https://hermes3.mysterium.network/ + await token.approve(registryAddress, hermesStake, { from: account }) await registry.registerHermes(hermesOperator, hermesStake, hermesFee, minChannelStake, maxChannelStake, url, { from: account }) const hermesAddress = await registry.getHermesAddress(hermesOperator)