"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.connectContracts = void 0;
// Contract addresses
// eslint-disable-next-line @typescript-eslint/no-var-requires
const DEPLOYED_CONTRACTS = require('@graphprotocol/contracts/addresses.json');
// Contract factories
const Curation__factory_1 = require("@graphprotocol/contracts/dist/types/factories/Curation__factory");
const DisputeManager__factory_1 = require("@graphprotocol/contracts/dist/types/factories/DisputeManager__factory");
const EpochManager__factory_1 = require("@graphprotocol/contracts/dist/types/factories/EpochManager__factory");
const GNS__factory_1 = require("@graphprotocol/contracts/dist/types/factories/GNS__factory");
const RewardsManager__factory_1 = require("@graphprotocol/contracts/dist/types/factories/RewardsManager__factory");
const ServiceRegistry__factory_1 = require("@graphprotocol/contracts/dist/types/factories/ServiceRegistry__factory");
const Staking__factory_1 = require("@graphprotocol/contracts/dist/types/factories/Staking__factory");
const GraphToken__factory_1 = require("@graphprotocol/contracts/dist/types/factories/GraphToken__factory");
const Controller__factory_1 = require("@graphprotocol/contracts/dist/types/factories/Controller__factory");
exports.connectContracts = (providerOrSigner, chainId) => __awaiter(void 0, void 0, void 0, function* () {
    const hardhatDeployedContracts = {
        IENS: {
            address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
        },
        IEthereumDIDRegistry: {
            address: '0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B',
        },
        GraphProxyAdmin: {
            address: '0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab',
            creationCodeHash: '0x26a6f47e71ad242e264768571ce7223bf5a86fd0113ab6cb8200f65820232904',
            runtimeCodeHash: '0xd5330527cfb09df657adc879d8ad704ce6b8d5917265cabbd3eb073d1399f122',
            txHash: '0x91733b710bd05165c65489499a9e9c8017c4bdeb62f0148ab67d992b09132b28',
        },
        BancorFormula: {
            address: '0x5b1869D9A4C187F2EAa108f3062412ecf0526b24',
            creationCodeHash: '0x0ed95869cfb576e5147fd72932c26be5ecf2591248d3796ce0b6510bd6f5a922',
            runtimeCodeHash: '0x34ddeaa6e34c7b878dd36f594b8f66de155b20f591652611ae903471e92de247',
            txHash: '0x31c3e5e1e85162fbb4b936cb69e4ade3e9e4ad4bb551ed92bd0dd0a926b762b0',
        },
        Controller: {
            address: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601',
            creationCodeHash: '0x7f37a1844c38fffd5390d2114804ffc4e5cf66dfb5c7bd67a32a4f5d10eebd2d',
            runtimeCodeHash: '0x929c62381fbed59483f832611752177cc2642e1e35fedeeb6cd9703e278448a0',
            txHash: '0x8369563e5e20580fb1af0defeab32cc33e72ea2f3faf5e354a7e2f103e5d4f88',
        },
        EpochManager: {
            address: '0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B',
            initArgs: [
                {
                    name: 'controller',
                    value: '0x24CCD4D3Ac8529fF08c58F74ff6755036E616117',
                },
                {
                    name: 'lengthInBlocks',
                    value: 6646,
                },
            ],
            creationCodeHash: '0xd6f2ecd3617cb54605636c7cc4f406cd35219e57135c2fd5ba5c0f0ca00831d4',
            runtimeCodeHash: '0x5c7418eff01832e48fa6f1554eff8fe666153f334dd25f1647c21969b4dc3805',
            txHash: '0xf41cf44f8a685fdf8318127b6207bdca405e6f8665613cb310a49d286b4b9c2b',
            proxy: true,
            implementation: {
                address: '0xC89Ce4735882C9F0f0FE26686c53074E09B0D550',
                creationCodeHash: '0xeca163275c4e4925916cf6caf8b7404685c7e205a8a719e17213949955fb7dcb',
                runtimeCodeHash: '0x6dba5ff389630c2d8d24b61344eaf7b9a297b963c89fecd4ea4b6839bc10c915',
                txHash: '0xc0d1c2cb80bf68058abf7ad313515799a253b3613cebb18e74a5cc7209e6ad2a',
            },
        },
        GraphToken: {
            address: '0x9561C133DD8580860B6b7E504bC5Aa500f0f06a7',
            constructorArgs: [
                {
                    name: 'initialSupply',
                    value: '10000000000000000000000000000',
                },
            ],
            creationCodeHash: '0x7744969c092c29a6e1d004dc75178b9876b4c41a941376775fc78560c97e13a7',
            runtimeCodeHash: '0x3ab84c121ebe80eb51e611b720c8bbe6afc80777a7c548edb96ddba28133a73e',
            txHash: '0x1963837d323f34dd6c41d210e35c67bfc8215cc99fd686d2a89cf75c7b651c74',
        },
        ServiceRegistry: {
            address: '0xe982E462b094850F12AF94d21D470e21bE9D0E9C',
            initArgs: [
                {
                    name: 'controller',
                    value: '0x24CCD4D3Ac8529fF08c58F74ff6755036E616117',
                },
            ],
            creationCodeHash: '0xc7f3cbb157b41e905f16d35281406813b12f83029234cd58b65cc0b231037ed0',
            runtimeCodeHash: '0x31ebf161bd89bbaf5d7c6990a3505f7f052d51f3ff1d4937ecce8dc4893299e8',
            txHash: '0xbd171861346aa61f72681c2fbaf116e82be74c8fcb8743e01a22dc0bc7068bca',
            proxy: true,
            implementation: {
                address: '0x59d3631c86BbE35EF041872d502F218A39FBa150',
                creationCodeHash: '0xeca163275c4e4925916cf6caf8b7404685c7e205a8a719e17213949955fb7dcb',
                runtimeCodeHash: '0x6dba5ff389630c2d8d24b61344eaf7b9a297b963c89fecd4ea4b6839bc10c915',
                txHash: '0x76c067bcc689f0dbfd1a9c0c20f20812e37ca89def668e52a4d50ae9f22cf31c',
            },
        },
        Curation: {
            address: '0x9b1f7F645351AF3631a656421eD2e40f2802E6c0',
            initArgs: [
                {
                    name: 'controller',
                    value: '0x24CCD4D3Ac8529fF08c58F74ff6755036E616117',
                },
                {
                    name: 'bondingCurve',
                    value: '0x5b1869D9A4C187F2EAa108f3062412ecf0526b24',
                },
                {
                    name: 'reserveRatio',
                    value: 500000,
                },
                {
                    name: 'curationTaxPercentage',
                    value: 25000,
                },
                {
                    name: 'minimumCurationDeposit',
                    value: '1000000000000000000',
                },
            ],
            creationCodeHash: '0x9993b8024d9733521ca120543e4ce63a54d7630a4c6ddaffb546dd535dff23de',
            runtimeCodeHash: '0x01c6fece1a300cdb2ca0d2a1b77cb6d520fce2e9a024901ead4177aabe20fd6a',
            txHash: '0x64d8d94e21f1923bd1793011ba28f24befd57b511622920716238b05595dac7d',
            proxy: true,
            implementation: {
                address: '0x67B5656d60a809915323Bf2C40A8bEF15A152e3e',
                creationCodeHash: '0xeca163275c4e4925916cf6caf8b7404685c7e205a8a719e17213949955fb7dcb',
                runtimeCodeHash: '0x6dba5ff389630c2d8d24b61344eaf7b9a297b963c89fecd4ea4b6839bc10c915',
                txHash: '0xbf141c1f72ea562017f0d5cc33c8a2ae24cbad91379edec269ed5e87e1d846d4',
            },
        },
        GNS: {
            address: '0xA57B8a5584442B467b4689F1144D269d096A3daF',
            initArgs: [
                {
                    name: 'controller',
                    value: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601',
                },
                {
                    name: 'bondingCurve',
                    value: '0x5b1869D9A4C187F2EAa108f3062412ecf0526b24',
                },
                {
                    name: 'didRegistry',
                    value: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b',
                },
            ],
            creationCodeHash: '0xe56742e5ea0a4dc4900246a10bb745e7d51f1fa1553a19ea0529676c9dd4d95e',
            runtimeCodeHash: '0xbd00b4ec6daac75d26dcec790a369c531709916b245c4b6772fe1448ed53adbf',
            txHash: '0x5dcb36dee3f895d5dc698749b7be6096d24dabfd8cf1a28dd607ac5a9a0bfaae',
            proxy: true,
            implementation: {
                address: '0x26b4AFb60d6C903165150C6F0AA14F8016bE4aec',
                creationCodeHash: '0xeca163275c4e4925916cf6caf8b7404685c7e205a8a719e17213949955fb7dcb',
                runtimeCodeHash: '0x6dba5ff389630c2d8d24b61344eaf7b9a297b963c89fecd4ea4b6839bc10c915',
                txHash: '0x1ebc6a08748ea9837d1fd370a1415f943b478c380fb51c429615989b7fbb06a5',
            },
        },
        Staking: {
            address: '0xDb56f2e9369E0D7bD191099125a3f6C370F8ed15',
            initArgs: [
                {
                    name: 'controller',
                    value: '0x24CCD4D3Ac8529fF08c58F74ff6755036E616117',
                },
                {
                    name: 'minimumIndexerStake',
                    value: '100000000000000000000000',
                },
                {
                    name: 'thawingPeriod',
                    value: 186092,
                },
                {
                    name: 'protocolPercentage',
                    value: 10000,
                },
                {
                    name: 'curationPercentage',
                    value: 100000,
                },
                {
                    name: 'channelDisputeEpochs',
                    value: 7,
                },
                {
                    name: 'maxAllocationEpochs',
                    value: 28,
                },
                {
                    name: 'delegationUnbondingPeriod',
                    value: 28,
                },
                {
                    name: 'delegationRatio',
                    value: 16,
                },
                {
                    name: 'rebateAlphaNumerator',
                    value: 77,
                },
                {
                    name: 'rebateAlphaDenominator',
                    value: 100,
                },
            ],
            creationCodeHash: '0x71a649a2c12c0b729d1d0d8dc15804d85fa0c14b7b0099159e226935c496f201',
            runtimeCodeHash: '0x620cf92657f36da78b6f40ccefe711bb11f7d88e9c7be94c266b49e89054ad8c',
            txHash: '0xefb6f00d56b79c87787d28f9fcc926ae2d7e23e2637ea53f26de5824fd3a5e12',
            proxy: true,
            implementation: {
                address: '0xA94B7f0465E98609391C623d0560C5720a3f2D33',
                creationCodeHash: '0xeca163275c4e4925916cf6caf8b7404685c7e205a8a719e17213949955fb7dcb',
                runtimeCodeHash: '0x6dba5ff389630c2d8d24b61344eaf7b9a297b963c89fecd4ea4b6839bc10c915',
                txHash: '0xb0d612c7cbb3a68b13056a8645faaa7c85049b33caefc4507c06a9dd97a962fd',
                libraries: {
                    LibCobbDouglas: '0x0E696947A06550DEf604e82C26fd9E493e576337',
                },
            },
        },
        RewardsManager: {
            address: '0xb09bCc172050fBd4562da8b229Cf3E45Dc3045A6',
            initArgs: [
                {
                    name: 'controller',
                    value: '0x24CCD4D3Ac8529fF08c58F74ff6755036E616117',
                },
                {
                    name: 'issuanceRate',
                    value: '1000000012184945188',
                },
            ],
            creationCodeHash: '0xda41e4019aa35f9788d42310906eefa9440b58ad19ba3cfc80fabf04c61f3969',
            runtimeCodeHash: '0x7a7df0556e7750b56ce5d531e27776962c563d67b2e82449746f9065c3c26950',
            txHash: '0xc3d115e6078fcdf44a5079da3dcecbc80fdb9af963e8832f776ee9f1720331ab',
            proxy: true,
            implementation: {
                address: '0xFC628dd79137395F3C9744e33b1c5DE554D94882',
                creationCodeHash: '0xeca163275c4e4925916cf6caf8b7404685c7e205a8a719e17213949955fb7dcb',
                runtimeCodeHash: '0x6dba5ff389630c2d8d24b61344eaf7b9a297b963c89fecd4ea4b6839bc10c915',
                txHash: '0xbed71020ebea63ca8e98b5fe4830f4d08a77a47f2c578431f31dfebabb50c0a5',
            },
        },
        DisputeManager: {
            address: '0x21a59654176f2689d12E828B77a783072CD26680',
            initArgs: [
                {
                    name: 'controller',
                    value: '0x24CCD4D3Ac8529fF08c58F74ff6755036E616117',
                },
                {
                    name: 'arbitrator',
                    value: '0xE1FDD398329C6b74C14cf19100316f0826a492d3',
                },
                {
                    name: 'minimumDeposit',
                    value: '10000000000000000000000',
                },
                {
                    name: 'fishermanRewardPercentage',
                    value: 500000,
                },
                {
                    name: 'slashingPercentage',
                    value: 25000,
                },
            ],
            creationCodeHash: '0x1ef8ded322e06b39ec56c5108415948eec9c1c7893b6a8ec0d92c7921f5e0310',
            runtimeCodeHash: '0xb462ec9dcb62a123edee6f4136b48a55cc11140746879e6ee4b1a9f332566232',
            txHash: '0x3abe7627964b8a1f768400f73589577e1ea40d620509c54c00f56f3520f93947',
            proxy: true,
            implementation: {
                address: '0xD86C8F0327494034F60e25074420BcCF560D5610',
                creationCodeHash: '0xeca163275c4e4925916cf6caf8b7404685c7e205a8a719e17213949955fb7dcb',
                runtimeCodeHash: '0x6dba5ff389630c2d8d24b61344eaf7b9a297b963c89fecd4ea4b6839bc10c915',
                txHash: '0x294b81d7f25b353e70cacbc30ca99c1e270e86d8d2701eb7a9ce94165621a9a7',
            },
        },
        AllocationExchange: {
            address: '0x4a53cf3b3EdA545dc61dee0cA21eA8996C94385f',
            initArgs: [
                {
                    name: 'graphToken',
                    value: '0xc944e90c64b2c07662a292be6244bdf05cda44a7',
                },
                {
                    name: 'staking',
                    value: '0xf55041e37e12cd407ad00ce2910b8269b01263b9',
                },
                {
                    name: 'governor',
                    value: '0x74db79268e63302d3fc69fb5a7627f7454a41732',
                },
                {
                    name: 'authority',
                    value: '0x79fd74da4c906509862c8fe93e87a9602e370bc4',
                },
            ],
            creationCodeHash: '0x1c7b0d7e81fc15f8ccc5b159e2cedb1f152653ebbce895b59eb74a1b26826fda',
            runtimeCodeHash: '0xa63c77e0724a5f679660358452e388f60379f1331e74542afb1436ffb213b960',
            txHash: '0x2ecd036c562f2503af9eaa1a9bca3729bd31ec8a91677530eefbecb398b793ba',
        },
    };
    return {
        curation: Curation__factory_1.Curation__factory.connect(hardhatDeployedContracts.Curation.address, providerOrSigner),
        disputeManager: DisputeManager__factory_1.DisputeManager__factory.connect(hardhatDeployedContracts.DisputeManager.address, providerOrSigner),
        epochManager: EpochManager__factory_1.EpochManager__factory.connect(hardhatDeployedContracts.EpochManager.address, providerOrSigner),
        gns: GNS__factory_1.GNS__factory.connect(hardhatDeployedContracts.GNS.address, providerOrSigner),
        rewardsManager: RewardsManager__factory_1.RewardsManager__factory.connect(hardhatDeployedContracts.RewardsManager.address, providerOrSigner),
        serviceRegistry: ServiceRegistry__factory_1.ServiceRegistry__factory.connect(hardhatDeployedContracts.ServiceRegistry.address, providerOrSigner),
        staking: Staking__factory_1.Staking__factory.connect(hardhatDeployedContracts.Staking.address, providerOrSigner),
        token: GraphToken__factory_1.GraphToken__factory.connect(hardhatDeployedContracts.GraphToken.address, providerOrSigner),
        controller: Controller__factory_1.Controller__factory.connect(hardhatDeployedContracts.Controller.address, providerOrSigner),
    };
});
//# sourceMappingURL=index.js.map