Skip to content
Snippets Groups Projects
Commit 74098505 authored by Otto Zaiser's avatar Otto Zaiser
Browse files

Testeando

parent 5f6c7ba4
No related branches found
No related tags found
No related merge requests found
...@@ -2,345 +2,407 @@ ...@@ -2,345 +2,407 @@
var abiBallot = [ var abiBallot = [
{ {
"name": "vote", "constant": false,
"type": "function", "inputs": [
"payable": false, {
"constant": false, "name": "proposal",
"stateMutability": "nonpayable", "type": "uint256"
"inputs": [ }
{ ],
"name": "proposal", "name": "vote",
"type": "uint256" "outputs": [],
} "payable": false,
], "stateMutability": "nonpayable",
"outputs": [] "type": "function"
}, },
{ {
"name": "ballotPercentOfRegisteredVotersReqToBeValid", "constant": true,
"type": "function", "inputs": [],
"payable": false, "name": "ballotPercentOfRegisteredVotersReqToBeValid",
"constant": true, "outputs": [
"inputs": [], {
"stateMutability": "view", "name": "",
"outputs": [ "type": "uint256"
{ }
"name": "", ],
"type": "uint256" "payable": false,
} "stateMutability": "view",
] "type": "function"
}, },
{ {
"name": "voterMap", "constant": true,
"type": "function", "inputs": [],
"payable": false, "name": "proposalListLength",
"constant": true, "outputs": [
"stateMutability": "view", {
"inputs": [ "name": "",
{ "type": "uint256"
"name": "", }
"type": "address" ],
} "payable": false,
], "stateMutability": "view",
"outputs": [ "type": "function"
{ },
"name": "", {
"type": "uint256" "constant": true,
} "inputs": [
] {
}, "name": "",
{ "type": "address"
"name": "getVoterIdx", }
"type": "function", ],
"payable": false, "name": "voterMap",
"constant": true, "outputs": [
"stateMutability": "view", {
"inputs": [ "name": "",
{ "type": "uint256"
"name": "voter", }
"type": "address" ],
} "payable": false,
], "stateMutability": "view",
"outputs": [ "type": "function"
{ },
"name": "", {
"type": "int256" "constant": true,
} "inputs": [
] {
}, "name": "voter",
{ "type": "address"
"name": "uncreate", }
"type": "function", ],
"payable": false, "name": "getVoterIdx",
"constant": false, "outputs": [
"stateMutability": "nonpayable", {
"inputs": [], "name": "",
"outputs": [] "type": "int256"
}, }
{ ],
"name": "voterList", "payable": false,
"type": "function", "stateMutability": "view",
"payable": false, "type": "function"
"constant": true, },
"stateMutability": "view", {
"inputs": [ "constant": false,
{ "inputs": [],
"name": "", "name": "uncreate",
"type": "uint256" "outputs": [],
} "payable": false,
], "stateMutability": "nonpayable",
"outputs": [ "type": "function"
{ },
"name": "voter", {
"type": "address" "constant": true,
}, "inputs": [
{ {
"name": "votesLeft", "name": "",
"type": "uint256" "type": "uint256"
} }
] ],
}, "name": "voterList",
{ "outputs": [
"name": "ballotCountNonvotesAsBlanks", {
"type": "function", "name": "voter",
"payable": false, "type": "address"
"constant": true, },
"stateMutability": "view", {
"inputs": [], "name": "votesLeft",
"outputs": [ "type": "uint256"
{ }
"name": "", ],
"type": "bool" "payable": false,
} "stateMutability": "view",
] "type": "function"
}, },
{ {
"name": "ballotVoteBefore", "constant": true,
"type": "function", "inputs": [],
"payable": false, "name": "ballotCountNonvotesAsBlanks",
"constant": true, "outputs": [
"stateMutability": "view", {
"inputs": [], "name": "",
"outputs": [ "type": "bool"
{ }
"name": "", ],
"type": "uint256" "payable": false,
} "stateMutability": "view",
] "type": "function"
}, },
{ {
"constant": false, "constant": true,
"inputs": [ "inputs": [],
{ "name": "ballotVoteBefore",
"name": "voters", "outputs": [
"type": "address[]" {
} "name": "",
], "type": "uint256"
"name": "giveRightToVote", }
"outputs": [], ],
"payable": false, "payable": false,
"stateMutability": "nonpayable", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
"constant": true, "constant": false,
"inputs": [], "inputs": [
"name": "ballotVoteStarts", {
"outputs": [ "name": "voters",
{ "type": "address[]"
"name": "", }
"type": "uint256" ],
} "name": "giveRightToVote",
], "outputs": [],
"payable": false, "payable": false,
"stateMutability": "view", "stateMutability": "nonpayable",
"type": "function" "type": "function"
}, },
{ {
"constant": true, "constant": true,
"inputs": [], "inputs": [],
"name": "ballotMaxVotesPerProposal", "name": "ballotVoteStarts",
"outputs": [ "outputs": [
{ {
"name": "", "name": "",
"type": "uint256" "type": "uint256"
} }
], ],
"payable": false, "payable": false,
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
"constant": true, "constant": true,
"inputs": [], "inputs": [],
"name": "ballotMaxVotesPerVoter", "name": "ballotMaxVotesPerProposal",
"outputs": [ "outputs": [
{ {
"name": "", "name": "",
"type": "uint256" "type": "uint256"
} }
], ],
"payable": false, "payable": false,
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
"constant": true, "constant": true,
"inputs": [], "inputs": [],
"name": "ballotTitle", "name": "ballotMaxVotesPerVoter",
"outputs": [ "outputs": [
{ {
"name": "", "name": "",
"type": "string" "type": "uint256"
} }
], ],
"payable": false, "payable": false,
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
"constant": true, "constant": true,
"inputs": [ "inputs": [],
{ "name": "getTotalVoltes",
"name": "", "outputs": [
"type": "uint256" {
} "name": "",
], "type": "uint256"
"name": "proposalList", }
"outputs": [ ],
{ "payable": false,
"name": "", "stateMutability": "view",
"type": "bytes32" "type": "function"
} },
], {
"payable": false, "constant": true,
"stateMutability": "view", "inputs": [],
"type": "function" "name": "ballotTitle",
}, "outputs": [
{ {
"constant": true, "name": "",
"inputs": [], "type": "string"
"name": "ballotPercentOfVotesCastToWin", }
"outputs": [ ],
{ "payable": false,
"name": "", "stateMutability": "view",
"type": "uint256" "type": "function"
} },
], {
"payable": false, "constant": true,
"stateMutability": "view", "inputs": [
"type": "function" {
}, "name": "",
{ "type": "uint256"
"constant": true, }
"inputs": [], ],
"name": "ballotChairman", "name": "proposalList",
"outputs": [ "outputs": [
{ {
"name": "", "name": "",
"type": "address" "type": "bytes32"
} }
], ],
"payable": false, "payable": false,
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
"inputs": [ "constant": true,
{ "inputs": [],
"name": "title", "name": "ballotPercentOfVotesCastToWin",
"type": "string" "outputs": [
}, {
{ "name": "",
"name": "voteStarts", "type": "uint256"
"type": "uint256" }
}, ],
{ "payable": false,
"name": "voteBefore", "stateMutability": "view",
"type": "uint256" "type": "function"
}, },
{ {
"name": "percentOfRegisteredVotersReqToBeValid", "constant": true,
"type": "uint256" "inputs": [],
}, "name": "ballotChairman",
{ "outputs": [
"name": "percentOfVotesCastToWin", {
"type": "uint256" "name": "",
}, "type": "address"
{ }
"name": "countNonvotesAsBlanks", ],
"type": "bool" "payable": false,
}, "stateMutability": "view",
{ "type": "function"
"name": "maxVotesPerVoter", },
"type": "uint256" {
}, "constant": true,
{ "inputs": [
"name": "maxVotesPerProposal", {
"type": "uint256" "name": "",
}, "type": "uint256"
{ }
"name": "proposalNames", ],
"type": "bytes32[]" "name": "votedProposalList",
} "outputs": [
], {
"payable": false, "name": "",
"stateMutability": "nonpayable", "type": "uint256"
"type": "constructor" }
} ],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "title",
"type": "string"
},
{
"name": "voteStarts",
"type": "uint256"
},
{
"name": "voteBefore",
"type": "uint256"
},
{
"name": "percentOfRegisteredVotersReqToBeValid",
"type": "uint256"
},
{
"name": "percentOfVotesCastToWin",
"type": "uint256"
},
{
"name": "countNonvotesAsBlanks",
"type": "bool"
},
{
"name": "maxVotesPerVoter",
"type": "uint256"
},
{
"name": "maxVotesPerProposal",
"type": "uint256"
},
{
"name": "proposalNames",
"type": "bytes32[]"
},
{
"name": "voters",
"type": "address[]"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}
]; ];
// $ solc --abi src/Ballot.sol | tail -1 | jq // $ solc --abi src/Ballot.sol | tail -1 | jq
var abiNew = [ var abiNew = [
{ {
"constant": false, "constant": false,
"inputs": [ "inputs": [
{ {
"name": "title", "name": "title",
"type": "string" "type": "string"
}, },
{ {
"name": "voteStarts", "name": "voteStarts",
"type": "uint256" "type": "uint256"
}, },
{ {
"name": "voteBefore", "name": "voteBefore",
"type": "uint256" "type": "uint256"
}, },
{ {
"name": "percentOfRegisteredVotersReqToBeValid", "name": "percentOfRegisteredVotersReqToBeValid",
"type": "uint256" "type": "uint256"
}, },
{ {
"name": "percentOfVotesCastToWin", "name": "percentOfVotesCastToWin",
"type": "uint256" "type": "uint256"
}, },
{ {
"name": "countNonvotesAsBlanks", "name": "countNonvotesAsBlanks",
"type": "bool" "type": "bool"
}, },
{ {
"name": "maxVotesPerVoter", "name": "maxVotesPerVoter",
"type": "uint256" "type": "uint256"
}, },
{ {
"name": "maxVotesPerProposal", "name": "maxVotesPerProposal",
"type": "uint256" "type": "uint256"
}, },
{ {
"name": "proposalNames", "name": "proposalNames",
"type": "bytes32[]" "type": "bytes32[]"
} },
], {
"name": "newBallot", "name": "voters",
"outputs": [ "type": "address[]"
{ }
"name": "newaddr", ],
"type": "address" "name": "newBallot",
} "outputs": [],
], "payable": false,
"payable": false, "stateMutability": "nonpayable",
"stateMutability": "nonpayable", "type": "function"
"type": "function" },
} {
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "contrato",
"type": "address"
}
],
"name": "contratocreado",
"type": "event"
}
]; ];
var abiBallot=[{name:"vote",type:"function",payable:!1,constant:!1,stateMutability:"nonpayable",inputs:[{name:"proposal",type:"uint256"}],outputs:[]},{name:"ballotPercentOfRegisteredVotersReqToBeValid",type:"function",payable:!1,constant:!0,inputs:[],stateMutability:"view",outputs:[{name:"",type:"uint256"}]},{name:"voterMap",type:"function",payable:!1,constant:!0,stateMutability:"view",inputs:[{name:"",type:"address"}],outputs:[{name:"",type:"uint256"}]},{name:"getVoterIdx",type:"function",payable:!1,constant:!0,stateMutability:"view",inputs:[{name:"voter",type:"address"}],outputs:[{name:"",type:"int256"}]},{name:"uncreate",type:"function",payable:!1,constant:!1,stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"voterList",type:"function",payable:!1,constant:!0,stateMutability:"view",inputs:[{name:"",type:"uint256"}],outputs:[{name:"voter",type:"address"},{name:"votesLeft",type:"uint256"}]},{name:"ballotCountNonvotesAsBlanks",type:"function",payable:!1,constant:!0,stateMutability:"view",inputs:[],outputs:[{name:"",type:"bool"}]},{name:"ballotVoteBefore",type:"function",payable:!1,constant:!0,stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{constant:!1,inputs:[{name:"voters",type:"address[]"}],name:"giveRightToVote",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"ballotVoteStarts",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"ballotMaxVotesPerProposal",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"ballotMaxVotesPerVoter",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"ballotTitle",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"uint256"}],name:"proposalList",outputs:[{name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"ballotPercentOfVotesCastToWin",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"ballotChairman",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{name:"title",type:"string"},{name:"voteStarts",type:"uint256"},{name:"voteBefore",type:"uint256"},{name:"percentOfRegisteredVotersReqToBeValid",type:"uint256"},{name:"percentOfVotesCastToWin",type:"uint256"},{name:"countNonvotesAsBlanks",type:"bool"},{name:"maxVotesPerVoter",type:"uint256"},{name:"maxVotesPerProposal",type:"uint256"},{name:"proposalNames",type:"bytes32[]"}],payable:!1,stateMutability:"nonpayable",type:"constructor"}],abiNew=[{constant:!1,inputs:[{name:"title",type:"string"},{name:"voteStarts",type:"uint256"},{name:"voteBefore",type:"uint256"},{name:"percentOfRegisteredVotersReqToBeValid",type:"uint256"},{name:"percentOfVotesCastToWin",type:"uint256"},{name:"countNonvotesAsBlanks",type:"bool"},{name:"maxVotesPerVoter",type:"uint256"},{name:"maxVotesPerProposal",type:"uint256"},{name:"proposalNames",type:"bytes32[]"}],name:"newBallot",outputs:[{name:"newaddr",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"}]; // $ solc --abi src/Ballot.sol | head -4 | tail -1 | jq
\ No newline at end of file
var abiBallot = [
{
"constant": false,
"inputs": [
{
"name": "proposal",
"type": "uint256"
}
],
"name": "vote",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ballotPercentOfRegisteredVotersReqToBeValid",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "proposalListLength",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "voterMap",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "voter",
"type": "address"
}
],
"name": "getVoterIdx",
"outputs": [
{
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "uncreate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "voterList",
"outputs": [
{
"name": "voter",
"type": "address"
},
{
"name": "votesLeft",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ballotCountNonvotesAsBlanks",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ballotVoteBefore",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "voters",
"type": "address[]"
}
],
"name": "giveRightToVote",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ballotVoteStarts",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ballotMaxVotesPerProposal",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ballotMaxVotesPerVoter",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getTotalVoltes",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ballotTitle",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "proposalList",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ballotPercentOfVotesCastToWin",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ballotChairman",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "votedProposalList",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "title",
"type": "string"
},
{
"name": "voteStarts",
"type": "uint256"
},
{
"name": "voteBefore",
"type": "uint256"
},
{
"name": "percentOfRegisteredVotersReqToBeValid",
"type": "uint256"
},
{
"name": "percentOfVotesCastToWin",
"type": "uint256"
},
{
"name": "countNonvotesAsBlanks",
"type": "bool"
},
{
"name": "maxVotesPerVoter",
"type": "uint256"
},
{
"name": "maxVotesPerProposal",
"type": "uint256"
},
{
"name": "proposalNames",
"type": "bytes32[]"
},
{
"name": "voters",
"type": "address[]"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}
];
// $ solc --abi src/Ballot.sol | tail -1 | jq
var abiNew = [
{
"constant": false,
"inputs": [
{
"name": "title",
"type": "string"
},
{
"name": "voteStarts",
"type": "uint256"
},
{
"name": "voteBefore",
"type": "uint256"
},
{
"name": "percentOfRegisteredVotersReqToBeValid",
"type": "uint256"
},
{
"name": "percentOfVotesCastToWin",
"type": "uint256"
},
{
"name": "countNonvotesAsBlanks",
"type": "bool"
},
{
"name": "maxVotesPerVoter",
"type": "uint256"
},
{
"name": "maxVotesPerProposal",
"type": "uint256"
},
{
"name": "proposalNames",
"type": "bytes32[]"
},
{
"name": "voters",
"type": "address[]"
}
],
"name": "newBallot",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "contrato",
"type": "address"
}
],
"name": "contratocreado",
"type": "event"
}
];
...@@ -448,6 +448,7 @@ async function nueva_votacion(arguments, proposals, voters) { ...@@ -448,6 +448,7 @@ async function nueva_votacion(arguments, proposals, voters) {
async function contract_created(err, rcpt) { async function contract_created(err, rcpt) {
console.log(rcpt); console.log(rcpt);
alertarSuccess('La votación se creó correctamente, tome nota de su dirección: ' + rcpt); // the contract address
} }
async function ver_votacion(addr) { async function ver_votacion(addr) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment