Skip to content

Commit

Permalink
Use Arc v13 direct GP params setting (#7)
Browse files Browse the repository at this point in the history
* Use Arc v13 direct GP params setting

* Bump version

* Fix params hash

* Bump version
  • Loading branch information
ben-kaufman authored Apr 14, 2020
1 parent fea470b commit ea5c09d
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 90 deletions.
14 changes: 12 additions & 2 deletions abis/FundingRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,19 @@
"name": "_votingMachine",
"type": "address"
},
{
"internalType": "uint256[11]",
"name": "_votingParams",
"type": "uint256[11]"
},
{
"internalType": "address",
"name": "_voteOnBehalf",
"type": "address"
},
{
"internalType": "bytes32",
"name": "_voteParams",
"name": "_voteParamsHash",
"type": "bytes32"
},
{
Expand Down Expand Up @@ -495,7 +505,7 @@
{
"constant": true,
"inputs": [],
"name": "voteParams",
"name": "voteParamsHash",
"outputs": [
{
"internalType": "bytes32",
Expand Down
14 changes: 12 additions & 2 deletions abis/JoinAndQuit.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,19 @@
"name": "_votingMachine",
"type": "address"
},
{
"internalType": "uint256[11]",
"name": "_votingParams",
"type": "uint256[11]"
},
{
"internalType": "address",
"name": "_voteOnBehalf",
"type": "address"
},
{
"internalType": "bytes32",
"name": "_voteParams",
"name": "_voteParamsHash",
"type": "bytes32"
},
{
Expand Down Expand Up @@ -665,7 +675,7 @@
{
"constant": true,
"inputs": [],
"name": "voteParams",
"name": "voteParamsHash",
"outputs": [
{
"internalType": "bytes32",
Expand Down
14 changes: 12 additions & 2 deletions abis/SchemeFactory.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,19 @@
"name": "_votingMachine",
"type": "address"
},
{
"internalType": "uint256[11]",
"name": "_votingParams",
"type": "uint256[11]"
},
{
"internalType": "address",
"name": "_voteOnBehalf",
"type": "address"
},
{
"internalType": "bytes32",
"name": "_voteParams",
"name": "_voteParamsHash",
"type": "bytes32"
},
{
Expand Down Expand Up @@ -477,7 +487,7 @@
{
"constant": true,
"inputs": [],
"name": "voteParams",
"name": "voteParamsHash",
"outputs": [
{
"internalType": "bytes32",
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '3'
services:
ganache:
image: 'daostack/migration-experimental:0.1.1-rc.12-v1'
image: 'daostack/migration-experimental:0.1.1-rc.13-v0'
ports:
- '8545:8545'
70 changes: 49 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const ethers = require('ethers');
// Is the voteParams same for all/some schemes of a common?

// TODO: Edit constants/ Make them function params
const arcVersion = "0.1.1-rc.12";
const arcVersion = "0.1.1-rc.13";

function getForgeOrgData({
DAOFactoryInstance,
Expand Down Expand Up @@ -38,9 +38,6 @@ function getSetSchemesData({
DAOFactoryInstance,
avatar,
votingMachine,
joinAndQuitVoteParams,
fundingRequestVoteParams,
schemeFactoryVoteParams,
fundingToken,
minFeeToJoin,
memberReputation,
Expand All @@ -56,25 +53,28 @@ function getSetSchemesData({
let fundingRequest = new ethers.utils.Interface(fundingRequestABI);
let schemeFactory = new ethers.utils.Interface(schemeFactoryABI);

let joinAndQuitParamsHash = joinAndQuitVoteParams;
if (joinAndQuitVoteParams === "") {
joinAndQuitParamsHash = require('./schemesVoteParams/JoinAndQuitParams.json').paramsHash;
}

let fundingRequestParamsHash = fundingRequestVoteParams;
if (fundingRequestVoteParams === "") {
fundingRequestParamsHash = require('./schemesVoteParams/FundingRequestParams.json').paramsHash;
}

let schemeFactoryParamsHash = schemeFactoryVoteParams;
if (schemeFactoryVoteParams === "") {
schemeFactoryParamsHash = require('./schemesVoteParams/SchemeFactoryParams.json').paramsHash;
}
let joinAndQuitParams = require('./schemesVoteParams/JoinAndQuitParams.json');
let fundingRequestParams = require('./schemesVoteParams/FundingRequestParams.json');
let schemeFactoryParams = require('./schemesVoteParams/SchemeFactoryParams.json');

const joinAndQuitArgs = Object.values({
avatar,
votingMachine,
joinAndQuitParamsHash,
votingParams: [
joinAndQuitParams.queuedVoteRequiredPercentage,
joinAndQuitParams.queuedVotePeriodLimit,
joinAndQuitParams.boostedVotePeriodLimit,
joinAndQuitParams.preBoostedVotePeriodLimit,
joinAndQuitParams.thresholdConst,
joinAndQuitParams.quietEndingPeriod,
joinAndQuitParams.proposingRepReward,
joinAndQuitParams.votersReputationLossRatio,
joinAndQuitParams.minimumDaoBounty,
joinAndQuitParams.daoBountyConst,
joinAndQuitParams.activationTime
],
voteOnBehalf: joinAndQuitParams.voteOnBehalf,
joinAndQuitParamsHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
fundingToken,
minFeeToJoin,
memberReputation,
Expand All @@ -85,14 +85,42 @@ function getSetSchemesData({
const fundingRequestArgs = Object.values({
avatar,
votingMachine,
fundingRequestParamsHash,
votingParams: [
fundingRequestParams.queuedVoteRequiredPercentage,
fundingRequestParams.queuedVotePeriodLimit,
fundingRequestParams.boostedVotePeriodLimit,
fundingRequestParams.preBoostedVotePeriodLimit,
fundingRequestParams.thresholdConst,
fundingRequestParams.quietEndingPeriod,
fundingRequestParams.proposingRepReward,
fundingRequestParams.votersReputationLossRatio,
fundingRequestParams.minimumDaoBounty,
fundingRequestParams.daoBountyConst,
fundingRequestParams.activationTime
],
voteOnBehalf: fundingRequestParams.voteOnBehalf,
fundingRequestParamsHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
fundingToken,
});

const schemeFactoryArgs = Object.values({
avatar,
votingMachine,
schemeFactoryParamsHash,
votingParams: [
schemeFactoryParams.queuedVoteRequiredPercentage,
schemeFactoryParams.queuedVotePeriodLimit,
schemeFactoryParams.boostedVotePeriodLimit,
schemeFactoryParams.preBoostedVotePeriodLimit,
schemeFactoryParams.thresholdConst,
schemeFactoryParams.quietEndingPeriod,
schemeFactoryParams.proposingRepReward,
schemeFactoryParams.votersReputationLossRatio,
schemeFactoryParams.minimumDaoBounty,
schemeFactoryParams.daoBountyConst,
schemeFactoryParams.activationTime
],
voteOnBehalf: schemeFactoryParams.voteOnBehalf,
schemeFactoryParamsHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
DAOFactoryInstance,
});

Expand Down
91 changes: 44 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ea5c09d

Please sign in to comment.