Skip to content

Commit

Permalink
add the deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
FedokDL committed Jan 6, 2025
1 parent f708007 commit 5dbb7d0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions smart-contracts/deploy/3_delegate_protocol.migration copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,29 @@ import { Deployer } from '@solarity/hardhat-migrate';
import { parseConfig } from './helpers/config-parser';

import {
DelegatorFactory__factory,
DelegateFactory__factory,
ERC1967Proxy__factory,
ProvidersDelegator__factory,
ProvidersDelegate__factory,
} from '@/generated-types/ethers';
import { wei } from '@/scripts/utils/utils';

module.exports = async function (deployer: Deployer) {
const config = parseConfig();

const providersDelegatorImpl = await deployer.deploy(ProvidersDelegator__factory);
const delegatorFactoryImpl = await deployer.deploy(DelegatorFactory__factory);
const providersDelegatorImpl = await deployer.deploy(ProvidersDelegate__factory);
const delegatorFactoryImpl = await deployer.deploy(DelegateFactory__factory);
const proxy = await deployer.deploy(ERC1967Proxy__factory, [await delegatorFactoryImpl.getAddress(), '0x']);

const delegatorFactory = await deployer.deployed(DelegatorFactory__factory, await proxy.getAddress());
const delegatorFactory = await deployer.deployed(DelegateFactory__factory, await proxy.getAddress());

await delegatorFactory.DelegatorFactory_init(config.lumerinProtocol, providersDelegatorImpl);
await delegatorFactory.DelegateFactory_init(config.lumerinProtocol, providersDelegatorImpl, 60 * 60);

await delegatorFactory.deployProxy(
'0x19ec1E4b714990620edf41fE28e9a1552953a7F4',
wei(0.2, 25),
'First Subnet',
'Custom endpoint',
60 * 60 * 1,
60 * 30,
Math.floor((Date.now() / 1000)) + 24 * 60 * 60,
);
};

Expand Down

0 comments on commit 5dbb7d0

Please sign in to comment.