diff --git a/scripts/deploy/README.md b/scripts/deploy/README.md index dda5956..832d880 100644 --- a/scripts/deploy/README.md +++ b/scripts/deploy/README.md @@ -15,6 +15,4 @@ $ ./run.sh it will check checksums of the contracts, then will proceed to store necessary wasm binaries. -In the middle process will stop, and user must update `configs/factory_config.json` file with newly uploaded binaries ID. - All necessary output is stored in `result.json` file. diff --git a/scripts/deploy/configs/gauges_config.json b/scripts/deploy/configs/gauges_config.json index 653b787..cc9c8b0 100644 --- a/scripts/deploy/configs/gauges_config.json +++ b/scripts/deploy/configs/gauges_config.json @@ -1,6 +1,6 @@ { "orchestrator": { - "label": "gauge v1.3.0-beta", + "label": "gauge orchestrator v1.3.0-beta", "instantiate": { "voting_powers": "paloma1al324k42hg47fz3qdnuy2s7wcfw8agny8gujmh", "owner": "paloma1zwskvpcpvplxacxef2ez5w9rpxcdkd54e9slnv" @@ -10,13 +10,15 @@ { "label": "gauge-adapter v1.3.0-beta ugrain", "instantiate": { - "factory": "paloma1r3zgdsn3dcze07a4r60rxxx7ppvkxfshn9np0pwtkgarrld0786sdssl9a", + "factory": "paloma1pt5d7rnkkz24sfutsld8c40r28py3jzgj95ml4ef7krtdr77xq0q47ufnv", "rewards_asset": { "info": { "native": "ugrains" }, "amount": "10000" - } + }, + "epoch_length": 164000, + "owner": "paloma1zwskvpcpvplxacxef2ez5w9rpxcdkd54e9slnv" } } ], @@ -24,10 +26,10 @@ { "create_gauge": { "title": "gauge rewards paloma", - "adapter": "paloma1sthrn5ep8ls5vzz8f9gp89khhmedahhdqd244dh9uqzk3hx2pzrsr8facx", + "adapter": "paloma1ttrgu24gmfxg0mymf02awyx2kaepvnz7k75zsn87s65kds86yepsc2g2ku", "epoch_size": 86400, "max_options_selected": 3 } } ] -} +} \ No newline at end of file diff --git a/scripts/deploy/configs/multi_hop_config.json b/scripts/deploy/configs/multi_hop_config.json index 0a6601a..c2e4ae1 100644 --- a/scripts/deploy/configs/multi_hop_config.json +++ b/scripts/deploy/configs/multi_hop_config.json @@ -1,6 +1,6 @@ { "label": "palomadex-multi-hop v0.4.0", "instantiate": { - "wyndex_factory": "paloma1cspcn0rdpxtarxxyra0mctys0s3zg584at9m8q6p2wn99m4fxupsp2zukk" + "wyndex_factory": "paloma1pt5d7rnkkz24sfutsld8c40r28py3jzgj95ml4ef7krtdr77xq0q47ufnv" } } \ No newline at end of file diff --git a/scripts/deploy/index.js b/scripts/deploy/index.js index 7f621a8..972bdb0 100755 --- a/scripts/deploy/index.js +++ b/scripts/deploy/index.js @@ -284,8 +284,6 @@ async function createGauges(client, wallet, gasPriceS, messages, gaugeOrchestrat const gasPrice = GasPrice.fromString(gasPriceS); const executeFee = calculateFee(1_000_000, gasPrice); - var gauges = []; - for (var i = 0; i < messages.length; i++) { const result = await client.execute( wallet, @@ -293,19 +291,8 @@ async function createGauges(client, wallet, gasPriceS, messages, gaugeOrchestrat messages[i], executeFee ); - const wasmEvent = result.logs[0].events.find((e) => e.type === "wasm").attributes; - const gaugeAddress = wasmEvent.find(function (element) { - return element.key === '_contract_address' - }); - const gaugeInfo = { - gaugeLabel: messages[i].create_gauge.title, - gaugeAddress: gaugeAddress.value, - }; - console.info(`Gauge initialized:\n${JSON.stringify(gaugeInfo, null, 4)}\n`); - gauges.push(gaugeInfo); + console.info(`Gauge initialized: ${messages[i].create_gauge.title}\n`); }; - - return gauges; } async function main() { @@ -399,14 +386,12 @@ async function main() { // Instantiate gauge orchestrator const gaugeOrchestratorAddress = await instantiateContract(client, address, palomaConfig.gasPrice, gaugesConfig.orchestrator, gaugeOrchestratorCodeId); - // Update adapter config with correct gauge orchestrator address - gaugesConfig.adapters.forEach(adapter => { - adapter.instantiate.factory = factoryAddress; // Update factory address for each adapter - adapter.instantiate.gauge_orchestrator = gaugeOrchestratorAddress; // Add gauge orchestrator address to each adapter - }); - const gaugeAdapters = await instantiateGaugeAdapters(client, address, palomaConfig.gasPrice, gaugeAdapterCodeId, gaugesConfig.adapters); + gaugesConfig.gauges.forEach(gauge => { + gauge.create_gauge.adapter = gaugeAdapters[0].address; + }); + // Save the updated gauges config with gauge orchestrator and adapters addresses writeJsonConfig(gaugesConfigPath, gaugesConfig); @@ -425,9 +410,10 @@ async function main() { factoryAddress: factoryAddress, multiHopAddress: multiHopAddress, pairs: pairs, - // gaugeOrchestratorAddress: gaugeOrchestratorAddress, - // gaugeAdapters: gaugeAdapters, - // gauges: gauges + daoCore: daoCoreAddress, + gaugeOrchestratorAddress: gaugeOrchestratorAddress, + gaugeAdapters: gaugeAdapters, + gauges: gauges }; fs.writeFileSync("result.json", JSON.stringify(raport, null, 4), "utf8"); console.info("Result was saved to result.json file!");