Skip to content
Snippets Groups Projects
Commit a437e4ee authored by Patricio Kumagae's avatar Patricio Kumagae
Browse files

Corrijo error al validar cuenta

parent de1b3828
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,7 @@
</div>
<div class="modal-body">
<label>Desde la consola de geth ejecutar los siguientes comandos:</label>
<pre>abi = [ { "anonymous": false, "inputs": [ { "indexed": false, "name": "amount", "type": "uint256" } ], "name": "proofOfControlWeiAmountChanged", "type": "event" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" }, { "name": "limit", "type": "uint256" } ], "name": "addBeneficiary", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "add", "type": "address" }, { "name": "password", "type": "bytes32" } ], "name": "addSuitor", "outputs": [ { "name": "", "type": "bool" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" }, { "name": "limit", "type": "uint256" } ], "name": "changeLimit", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" } ], "name": "kickBeneficiary", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" } ], "name": "kickDistributor", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "distr", "type": "address" }, { "indexed": true, "name": "ben", "type": "address" }, { "indexed": false, "name": "newLimit", "type": "uint256" } ], "name": "limitChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "suitor", "type": "address" } ], "name": "suitorApproved", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "suitor", "type": "address" } ], "name": "suitorNotApproved", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "kicked", "type": "address" } ], "name": "kickedDistributor", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "suitor", "type": "address" }, { "indexed": true, "name": "distr", "type": "address" } ], "name": "suitorAdded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "distr", "type": "address" }, { "indexed": true, "name": "added", "type": "address" }, { "indexed": false, "name": "limit", "type": "uint256" } ], "name": "addedBeneficiary", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "distr", "type": "address" }, { "indexed": true, "name": "kicked", "type": "address" } ], "name": "kickedBeneficiary", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "added", "type": "address" }, { "indexed": false, "name": "top", "type": "uint256" } ], "name": "addedDistributor", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "distr", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" } ], "name": "replenished", "type": "event" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" }, { "name": "top", "type": "uint256" } ], "name": "addDistributor", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "key", "type": "string" } ], "name": "proveControl", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" }, { "name": "amount", "type": "uint256" } ], "name": "replenish", "outputs": [ { "name": "", "type": "bool" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [], "name": "replenishAll", "outputs": [ { "name": "", "type": "bool" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "name": "accs", "type": "address[]" }, { "name": "amounts", "type": "uint256[]" } ], "name": "replenishList", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "name": "amount", "type": "uint256" } ], "name": "setProofOfControlWeiAmount", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "payable": true, "stateMutability": "payable", "type": "constructor" }, { "constant": true, "inputs": [], "name": "getBeneficiariesCount", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "acc", "type": "address" } ], "name": "getBeneficiaryLimit", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "acc", "type": "address" } ], "name": "getDistributorLimit", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getProofOfControlWeiAmount", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "key", "type": "string" } ], "name": "hash", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "pure", "type": "function" }, { "constant": true, "inputs": [ { "name": "add", "type": "address" } ], "name": "isBeneficiary", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "add", "type": "address" } ], "name": "isDistributor", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" } ]<br /><br />var contractInstance = eth.contract(abi).at("<label id="label-contract-address"></label>")<br/><br/>eth.defaultAccount = "<label id="label-cuenta"></label>"<br /><br/>personal.unlockAccount(eth.defaultAccount, "<i><b>PASSPHRASE DE LA CUENTA</b></i>") // es necesario desbloquear la cuenta con la passphrase, OJO SI EL ATTACH ES CON HTTP<br/><br/>var tx = contractInstance.proveControl.sendTransaction("<label id="label-clave"></label>", {gas:eth.getBalance(eth.defaultAccount), gasPrice:1}) // efectivamente la transaccion<br/><br/>eth.getTransactionReceipt(tx) //esto puede devolver undefined, porque depende de si se sello el bloque con la transaccion
<pre>abi = [ { "anonymous": false, "inputs": [ { "indexed": false, "name": "amount", "type": "uint256" } ], "name": "proofOfControlWeiAmountChanged", "type": "event" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" }, { "name": "limit", "type": "uint256" } ], "name": "addBeneficiary", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "add", "type": "address" }, { "name": "password", "type": "bytes32" } ], "name": "addSuitor", "outputs": [ { "name": "", "type": "bool" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" }, { "name": "limit", "type": "uint256" } ], "name": "changeLimit", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" } ], "name": "kickBeneficiary", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" } ], "name": "kickDistributor", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "distr", "type": "address" }, { "indexed": true, "name": "ben", "type": "address" }, { "indexed": false, "name": "newLimit", "type": "uint256" } ], "name": "limitChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "suitor", "type": "address" } ], "name": "suitorApproved", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "suitor", "type": "address" } ], "name": "suitorNotApproved", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "kicked", "type": "address" } ], "name": "kickedDistributor", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "suitor", "type": "address" }, { "indexed": true, "name": "distr", "type": "address" } ], "name": "suitorAdded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "distr", "type": "address" }, { "indexed": true, "name": "added", "type": "address" }, { "indexed": false, "name": "limit", "type": "uint256" } ], "name": "addedBeneficiary", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "distr", "type": "address" }, { "indexed": true, "name": "kicked", "type": "address" } ], "name": "kickedBeneficiary", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "added", "type": "address" }, { "indexed": false, "name": "top", "type": "uint256" } ], "name": "addedDistributor", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "distr", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" } ], "name": "replenished", "type": "event" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" }, { "name": "top", "type": "uint256" } ], "name": "addDistributor", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "key", "type": "string" } ], "name": "proveControl", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "acc", "type": "address" }, { "name": "amount", "type": "uint256" } ], "name": "replenish", "outputs": [ { "name": "", "type": "bool" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [], "name": "replenishAll", "outputs": [ { "name": "", "type": "bool" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "name": "accs", "type": "address[]" }, { "name": "amounts", "type": "uint256[]" } ], "name": "replenishList", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "name": "amount", "type": "uint256" } ], "name": "setProofOfControlWeiAmount", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "payable": true, "stateMutability": "payable", "type": "constructor" }, { "constant": true, "inputs": [], "name": "getBeneficiariesCount", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "acc", "type": "address" } ], "name": "getBeneficiaryLimit", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "acc", "type": "address" } ], "name": "getDistributorLimit", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getProofOfControlWeiAmount", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "key", "type": "string" } ], "name": "hash", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "pure", "type": "function" }, { "constant": true, "inputs": [ { "name": "add", "type": "address" } ], "name": "isBeneficiary", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "add", "type": "address" } ], "name": "isDistributor", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" } ]<br /><br />var contractInstance = eth.contract(abi).at("<label id="label-contract-address"></label>")<br/><br/>eth.defaultAccount = "<label id="label-cuenta"></label>"<br /><br/>personal.unlockAccount(eth.defaultAccount, "<i><b>PASSPHRASE DE LA CUENTA</b></i>") // es necesario desbloquear la cuenta con la passphrase, OJO SI EL ATTACH ES CON HTTP<br/><br/>var estimate = contractInstance.proveControl.estimateGas("<label id="label-clave1"></label>")<br /><br />var tx = contractInstance.proveControl.sendTransaction("<label id="label-clave2"></label>", {gas:estimate, gasPrice:1}) // efectivamente la transaccion<br/><br/>eth.getTransactionReceipt(tx) //esto puede devolver undefined, porque depende de si se sello el bloque con la transaccion
</pre>
</div>
<div class="modal-footer">
......@@ -417,7 +417,8 @@
$('#modalInstrucciones').on('shown.bs.modal', function(e) {
$('#label-cuenta').html($('#address-'+$(e.relatedTarget).attr('id-account')).val());
$('#label-clave').html($(e.relatedTarget).attr('clave'));
$('#label-clave1').html($(e.relatedTarget).attr('clave'));
$('#label-clave2').html($(e.relatedTarget).attr('clave'));
$('#label-contract-address').html($('#distillery_address').val());
});
......
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