@skalenetwork/upgrade-tools 2.0.0-refactor.5 → 2.0.0-refactor.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import { BytesLike, Contract, UnsignedTransaction } from "ethers";
2
+ import { SkaleABIFile } from "../types/SkaleABIFile";
3
+ import { SafeSubmitter } from "./safe-submitter";
4
+ export declare class SafeToImaSubmitter extends SafeSubmitter {
5
+ messageProxyForMainnet: Contract;
6
+ targetSchainHash: BytesLike;
7
+ constructor(safeAddress: string, imaAbi: SkaleABIFile, targetSchainHash: BytesLike, chainId?: number);
8
+ submit(transactions: UnsignedTransaction[]): Promise<void>;
9
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SafeToImaSubmitter = void 0;
13
+ const hardhat_1 = require("hardhat");
14
+ const safe_submitter_1 = require("./safe-submitter");
15
+ class SafeToImaSubmitter extends safe_submitter_1.SafeSubmitter {
16
+ constructor(safeAddress, imaAbi, targetSchainHash, chainId) {
17
+ super(safeAddress, chainId);
18
+ this.messageProxyForMainnet = new hardhat_1.ethers.Contract(imaAbi["message_proxy_mainnet_address"], new hardhat_1.ethers.utils.Interface(imaAbi["message_proxy_mainnet_address"]));
19
+ this.targetSchainHash = targetSchainHash;
20
+ }
21
+ submit(transactions) {
22
+ const _super = Object.create(null, {
23
+ submit: { get: () => super.submit }
24
+ });
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ const transactionsToIma = transactions.map((transaction) => {
27
+ return {
28
+ to: this.messageProxyForMainnet.address,
29
+ data: this.messageProxyForMainnet.interface.encodeFunctionData("postOutgoingMessage", [this.targetSchainHash, transaction.to, transaction.data])
30
+ };
31
+ });
32
+ yield _super.submit.call(this, transactionsToIma);
33
+ });
34
+ }
35
+ }
36
+ exports.SafeToImaSubmitter = SafeToImaSubmitter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skalenetwork/upgrade-tools",
3
- "version": "2.0.0-refactor.5",
3
+ "version": "2.0.0-refactor.6",
4
4
  "description": "Scripts to support upgrades of smart contracts",
5
5
  "files": [
6
6
  "dist/**/*"