Skip to content

Commit

Permalink
Merge pull request #113 from valory-xyz/add_proposal
Browse files Browse the repository at this point in the history
chore: adding a proposal to create new bonding products
  • Loading branch information
kupermind authored Aug 7, 2023
2 parents 7831aa8 + baee1e1 commit 55498b8
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions scripts/proposals/proposal_05_create_bonding_products.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*global process*/

const { ethers } = require("hardhat");

async function main() {
const fs = require("fs");
const globalsFile = "globals.json";
const dataFromJSON = fs.readFileSync(globalsFile, "utf8");
let parsedData = JSON.parse(dataFromJSON);
const providerName = parsedData.providerName;

const provider = await ethers.providers.getDefaultProvider(providerName);
const signers = await ethers.getSigners();

const EOA = signers[0];
// EOA address
const deployer = await EOA.getAddress();
console.log("EOA is:", deployer);

// Get the depository contract addresses
const depositoryTwoAddress = parsedData.depositoryTwoAddress;

// Get contract instances
const depository = await ethers.getContractAt("Depository", depositoryTwoAddress);

// Additional products to create with depository contract
const oneDay = 3600 * 24;
const vestings = [8 * oneDay, 10 * oneDay, 12 * oneDay, 14 * oneDay, 14 * oneDay];
const pricesLP = ["295316122987384115698", "285963343501085551090", "276610564014786986482", "267257784528488421874", "257905005042189857266"];
const supplies = ["100000000000000000000000","150000000000000000000000","200000000000000000000000","200000000000000000000000","200000000000000000000000"];

const targets = new Array();
const values = new Array();
const callDatas = new Array();
for (let i = 0; i < pricesLP.length; i++) {
targets.push(depositoryTwoAddress);
values.push(0);
callDatas.push(depository.interface.encodeFunctionData("create", [parsedData.OLAS_ETH_PairAddress, pricesLP[i], supplies[i], vestings[i]]));
}

const description = "Create new bonding products";

// Proposal details
console.log("targets:", targets);
console.log("values:", values);
console.log("call datas:", callDatas);
console.log("description:", description);
}

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

0 comments on commit 55498b8

Please sign in to comment.