Skip to content

Commit

Permalink
fixes and update ctx value for camelot
Browse files Browse the repository at this point in the history
  • Loading branch information
Crisgarner committed Jun 13, 2023
1 parent 685ae27 commit ee20e22
Showing 1 changed file with 65 additions and 50 deletions.
115 changes: 65 additions & 50 deletions scripts/CIP-21.ts
Original file line number Diff line number Diff line change
@@ -1,68 +1,83 @@
// run with
// npx hardhat run ./scripts/CIP-21.ts --network hardhat
import hre, { deployments, network, hardhatArguments } from "hardhat";
import { castVote, createProposal, executeProposal, fundMultisign, queueProposal } from "./utils";
import {
castVote,
createProposal,
executeProposal,
fundMultisign,
queueProposal,
} from "./utils";
import { BigNumber } from "ethers";

async function main() {
const ethers = hre.ethers;
const ethers = hre.ethers;
let multisig = "0xa70b638B70154EdfCbb8DbbBd04900F328F32c35";
let skyNetAccount = "0xC8D26A776a8171225542a298b559622B7bad3A0A";
let ctxAmountMarketMaker = ethers.utils.parseEther("375000");
let ctxAmountCamelot = ethers.utils.parseEther("50000");
let ctx = await deployments.get("Ctx");
let ctxContract = await ethers.getContractAt("Ctx", ctx.address);

let multisig = "0xa70b638B70154EdfCbb8DbbBd04900F328F32c35";
let skyNetAccount ="0xC8D26A776a8171225542a298b559622B7bad3A0A";
let ctxAmountMarketMaker = ethers.utils.parseEther("375000");
let ctxAmountCamelot = ethers.utils.parseEther("45000");
let ctx = await deployments.get("Ctx");
let ctxContract = await ethers.getContractAt("Ctx", ctx.address);
const abi = new ethers.utils.AbiCoder();
const targets = [ctx.address, ctx.address];
const values = [BigNumber.from(0), BigNumber.from(0)];
const signatures = ["transfer(address,uint256)", "transfer(address,uint256)"];
const calldatas = [
abi.encode(["address", "uint256"], [skyNetAccount, ctxAmountMarketMaker]),
abi.encode(["address", "uint256"], [multisig, ctxAmountCamelot]),
];
const description =
"CIP 21: Liquidity Provisioning and Camelot DEX Integration";
console.log(targets);
console.log(values.toString());
console.log(signatures);
console.log(calldatas);
console.log(description);

const abi = new ethers.utils.AbiCoder();
const targets = [ctx.address,ctx.address];
const values = [BigNumber.from(0),BigNumber.from(0)];
const signatures = ["transfer(address,uint256)","transfer(address,uint256)"];
const calldatas = [
abi.encode(["address", "uint256"], [skyNetAccount, ctxAmountMarketMaker]),
abi.encode(["address", "uint256"], [multisig, ctxAmountCamelot])
];
const description = "CIP 21: Liquidity Provisioning and Camelot DEX Integration";
console.log(targets);
console.log(values.toString());
console.log(signatures);
console.log(calldatas);
console.log(description);
let ctxbalance = await ctxContract.balanceOf(multisig);
console.log("multisig old CTX balance", ethers.utils.formatEther(ctxbalance));
let ctxbalanceSkyNet = await ctxContract.balanceOf(skyNetAccount);
console.log(
"skyNet old CTX balance",
ethers.utils.formatEther(ctxbalanceSkyNet)
);

let ctxbalance = await ctxContract.balanceOf(multisig);
console.log("multisig old CTX balance", ethers.utils.formatEther(ctxbalance));
let ctxbalanceSkyNet = await ctxContract.balanceOf(skyNetAccount);
console.log("skyNet old CTX balance", ethers.utils.formatEther(ctxbalanceSkyNet));
if (hardhatArguments.network === "hardhat") {
//Fund Multisign with ETH
await fundMultisign("10000000000000000000");

if (hardhatArguments.network === "hardhat") {
//Fund Multisign with ETH
await fundMultisign("10000000000000000000");
// Create Proposal
await createProposal(targets, values, signatures, calldatas, description);

// Create Proposal
await createProposal(targets, values, signatures, calldatas, description);
// Vote
await castVote(12, true);

// Vote
await castVote(12, true);
// Wait to queue
await queueProposal(12);

// Wait to queue
await queueProposal(12);
// Execute transaction
await executeProposal(12);

// Execute transaction
await executeProposal(12);
// Validate Results
console.log("==================Check Results==================");

// Validate Results
console.log("==================Check Results==================");

ctxbalance = await ctxContract.balanceOf(multisig);
console.log("multisig new CTX balance", ethers.utils.formatEther(ctxbalance));
ctxbalanceSkyNet = await ctxContract.balanceOf(skyNetAccount);
console.log("skyNet new CTX balance", ethers.utils.formatEther(ctxbalanceSkyNet));
}
ctxbalance = await ctxContract.balanceOf(multisig);
console.log(
"multisig new CTX balance",
ethers.utils.formatEther(ctxbalance)
);
ctxbalanceSkyNet = await ctxContract.balanceOf(skyNetAccount);
console.log(
"skyNet new CTX balance",
ethers.utils.formatEther(ctxbalanceSkyNet)
);
}
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

0 comments on commit ee20e22

Please sign in to comment.