Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ai): introduce AIServiceRegistry contract (proxy version) #643

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions deploy/deploy_ai_service_registry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {HardhatRuntimeEnvironment} from "hardhat/types"
import {DeployFunction} from "hardhat-deploy/types"

import ContractDeployer from "../utils/deployer"

const func: DeployFunction = async function(hre: HardhatRuntimeEnvironment) {
const {deployments, getNamedAccounts} = hre // Get the deployments and getNamedAccounts which are provided by hardhat-deploy

const {deployer} = await getNamedAccounts() // Fetch named accounts from hardhat.config.ts

const contractDeployer = new ContractDeployer(deployer, deployments)
const controller = await contractDeployer.fetchDeployedController()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we don't directly interact with the controller by registering contracts, theoretically, we could simply utilize deployments.get("Controller"). However, I've retained this part in the script for two reasons: firstly, in case people wish to extend this deployment script later on, and secondly, to maintain consistency with other proxy deployment scripts like deploy_bonding_votes.ts.


const deploy = contractDeployer.deploy.bind(contractDeployer)

await deploy({
contract: "ServiceRegistry",
name: "AIServiceRegistry",
args: [controller.address],
proxy: true
})
}

func.tags = ["AI_SERVICE_REGISTRY"]
export default func
Loading
Loading