Skip to content

Commit

Permalink
Revert "format"
Browse files Browse the repository at this point in the history
This reverts commit 16b14f3.
  • Loading branch information
krzysztofziobro committed Dec 5, 2023
1 parent 16b14f3 commit 20714b5
Show file tree
Hide file tree
Showing 3 changed files with 360 additions and 411 deletions.
42 changes: 16 additions & 26 deletions azero/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { ApiPromise, WsProvider, Keyring } from "@polkadot/api";
import MembraneConstructors from "../types/constructors/membrane";
import TokenConstructors from "../types/constructors/token";
import GovernanceConstructors from "../types/constructors/governance";
import {
uploadCode,
Addresses,
storeAddresses,
estimateContractInit,
} from "./utils";
import "dotenv/config";
import "@polkadot/api-augment";
import { ApiPromise, WsProvider, Keyring } from '@polkadot/api';
import MembraneConstructors from '../types/constructors/membrane';
import TokenConstructors from '../types/constructors/token';
import GovernanceConstructors from '../types/constructors/governance';
import { uploadCode, Addresses, storeAddresses, estimateContractInit } from './utils';
import 'dotenv/config';
import '@polkadot/api-augment';

const envFile = process.env.AZERO_ENV || "dev";
async function import_env() {
Expand All @@ -25,7 +20,7 @@ async function main(): Promise<void> {
commission_per_dix_mille,
pocket_money,
minimum_transfer_amount_usd,
relay_gas_usage,
relay_gas_usage
} = await import_env();

let wsProvider = new WsProvider(ws_node);
Expand All @@ -51,19 +46,14 @@ async function main(): Promise<void> {
const membraneConstructors = new MembraneConstructors(api, deployer);
const tokenConstructors = new TokenConstructors(api, deployer);

let estimatedGasMembrane = await estimateContractInit(
api,
deployer,
"membrane.contract",
[
[authority],
signature_threshold!,
commission_per_dix_mille!,
pocket_money!,
minimum_transfer_amount_usd!,
relay_gas_usage!,
],
);
let estimatedGasMembrane = await estimateContractInit(api, deployer, 'membrane.contract', [
[authority],
signature_threshold!,
commission_per_dix_mille!,
pocket_money!,
minimum_transfer_amount_usd!,
relay_gas_usage!,
]);

const { address: membraneAddress } = await membraneConstructors.new(
[authority],
Expand Down
11 changes: 3 additions & 8 deletions eth/scripts/2_deploy_contracts.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
const fs = require("node:fs");
const hre = require("hardhat");

const COMMISSION_PER_DIX_MILLE = 30;
const MINIMUM_TRANSFER_AMOUNT_USD = 50;
const COMMISSION_PER_DIX_MILLE = 30
const MINIMUM_TRANSFER_AMOUNT_USD = 50

async function main() {
const accounts = await hre.ethers.getSigners();

// Membrane
const Membrane = await hre.ethers.getContractFactory("Membrane");
const membrane = await Membrane.deploy(
accounts.slice(0, 1),
1,
COMMISSION_PER_DIX_MILLE,
MINIMUM_TRANSFER_AMOUNT_USD,
);
const membrane = await Membrane.deploy(accounts.slice(0, 1), 1, COMMISSION_PER_DIX_MILLE, MINIMUM_TRANSFER_AMOUNT_USD);
const membraneAddress = await membrane.getAddress();

console.log("Membrane deployed to:", membraneAddress);
Expand Down
Loading

0 comments on commit 20714b5

Please sign in to comment.