Thereโs a way to deploy a contract with another contract and maybe do some fixes with that instead of using the cloud function way.
Hereโs an example
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract D {
uint public x;
constructor(uint a) {
x = a;
}
function setX(uint _x) public {
x = _x;
}
}
contract C {
uint public y;
// D public createdD;
constructor(uint _y) {
y = _y;
}
function createD(uint arg) public returns (D) {
D newD = new D(arg);
return newD;
}
function setY(uint _y) public{
y = _y;
}
}