chore: sync state and push to Gitea (Chain 138 deploy)
Made-with: Cursor
This commit is contained in:
62
migrations/9_deploy_dvm_chain138.js
Normal file
62
migrations/9_deploy_dvm_chain138.js
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Deploy only the DVM (DODO Vending Machine) stack for Chain 138.
|
||||
* Run with: truffle migrate -f 9 --to 9 --network chain138
|
||||
* Requires: .env with privKey and RPC_URL_138 (or CHAIN138_RPC_URL)
|
||||
*/
|
||||
const CloneFactory = artifacts.require("CloneFactory");
|
||||
const FeeRateModelTemplate = artifacts.require("FeeRateModel");
|
||||
const FeeRateDIP3 = artifacts.require("FeeRateDIP3Impl");
|
||||
const PermissionManagerTemplate = artifacts.require("PermissionManager");
|
||||
const DvmTemplate = artifacts.require("DVM");
|
||||
const DvmFactory = artifacts.require("DVMFactory");
|
||||
|
||||
module.exports = async function (deployer, network, accounts) {
|
||||
if (network !== "chain138") return;
|
||||
|
||||
const multiSig = accounts[0];
|
||||
const defaultMaintainer = accounts[0];
|
||||
|
||||
console.log("Deploying DVM stack on Chain 138 with maintainer:", multiSig);
|
||||
|
||||
await deployer.deploy(CloneFactory);
|
||||
const CloneFactoryAddress = CloneFactory.address;
|
||||
console.log("CloneFactory:", CloneFactoryAddress);
|
||||
|
||||
await deployer.deploy(FeeRateModelTemplate);
|
||||
const defaultMtFeeRateAddress = FeeRateModelTemplate.address;
|
||||
console.log("FeeRateModel:", defaultMtFeeRateAddress);
|
||||
const feeRateModelInstance = await FeeRateModelTemplate.at(defaultMtFeeRateAddress);
|
||||
await feeRateModelInstance.initOwner(multiSig);
|
||||
|
||||
await deployer.deploy(FeeRateDIP3);
|
||||
const feeRateDIP3Address = FeeRateDIP3.address;
|
||||
console.log("FeeRateDIP3Impl:", feeRateDIP3Address);
|
||||
const feeRateDIP3Instance = await FeeRateDIP3.at(feeRateDIP3Address);
|
||||
await feeRateDIP3Instance.initOwner(multiSig);
|
||||
|
||||
await deployer.deploy(PermissionManagerTemplate);
|
||||
const permissionManagerAddress = PermissionManagerTemplate.address;
|
||||
console.log("PermissionManager:", permissionManagerAddress);
|
||||
const permissionInstance = await PermissionManagerTemplate.at(permissionManagerAddress);
|
||||
await permissionInstance.initOwner(multiSig);
|
||||
|
||||
await deployer.deploy(DvmTemplate);
|
||||
const dvmTemplateAddress = DvmTemplate.address;
|
||||
console.log("DVM template:", dvmTemplateAddress);
|
||||
|
||||
await deployer.deploy(
|
||||
DvmFactory,
|
||||
CloneFactoryAddress,
|
||||
dvmTemplateAddress,
|
||||
defaultMaintainer,
|
||||
defaultMtFeeRateAddress
|
||||
);
|
||||
const dvmFactoryAddress = DvmFactory.address;
|
||||
console.log("DVMFactory:", dvmFactoryAddress);
|
||||
const dvmFactoryInstance = await DvmFactory.at(dvmFactoryAddress);
|
||||
await dvmFactoryInstance.initOwner(multiSig);
|
||||
|
||||
console.log("\n=== Chain 138 DVM deployment summary ===");
|
||||
console.log("DVMFactory (use this with an adapter for createDVM):", dvmFactoryAddress);
|
||||
console.log("Set DODO_VENDING_MACHINE_ADDRESS to the DVMFactoryAdapter address (deploy separately).");
|
||||
};
|
||||
30374
package-lock.json
generated
30374
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -279,6 +279,22 @@ module.exports = {
|
||||
skipDryRun: true
|
||||
},
|
||||
|
||||
chain138: {
|
||||
networkCheckTimeout: 60000,
|
||||
provider: () => {
|
||||
const rpc = process.env.RPC_URL_138 || process.env.CHAIN138_RPC_URL || "http://127.0.0.1:8545";
|
||||
return new HDWalletProvider({
|
||||
privateKeys: [privKey],
|
||||
providerOrUrl: rpc,
|
||||
chainId: 138
|
||||
});
|
||||
},
|
||||
network_id: "138",
|
||||
gas: 8000000,
|
||||
gasPrice: process.env.GAS_PRICE_138 ? parseInt(process.env.GAS_PRICE_138, 10) : 1000000000,
|
||||
skipDryRun: true
|
||||
},
|
||||
|
||||
coverage: {
|
||||
host: "127.0.0.1",
|
||||
port: 6545,
|
||||
|
||||
Reference in New Issue
Block a user