Updating contract due to #3

This commit is contained in:
Victor 2016-05-23 12:57:29 +03:00
parent 63cfdfdcd8
commit 2e02a0d8a2
15 changed files with 256 additions and 25 deletions

View File

@ -39,7 +39,7 @@ config.json with placeholders
} }
}, },
"smartContract": { "smartContract": {
"bin": "0x60606040525b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b6106a88061003f6000396000f36060604052361561008a576000357c0100000000000000000000000000000000000000000000000000000000900480631f83f440146101ef57806341c0e1b51461021b5780634636a1591461022a578063a02b9aac1461024b578063b958a5e1146102cf578063e3ffc9a3146102fb578063f37306531461030a578063fe97ee881461034c5761008a565b6101ed5b6060604051908101604052806000815260200167016345785d8a0000340481526020016000368080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050815260200150600260005060003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005060008201518160000160005055602082015181600101600050556040820151816002016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061018957805160ff19168380011785556101ba565b828001600101855582156101ba579182015b828111156101b957825182600050559160200191906001019061019b565b5b5090506101e591906101c7565b808211156101e157600081815060009055506001016101c7565b5090565b50509050505b565b005b6102056004808035906020019091905050610378565b6040518082815260200191505060405180910390f35b61022860048050506103bc565b005b610249600480803590602001909190803590602001909190505061041d565b005b6102616004808035906020019091905050610480565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156102c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e5600480803590602001909190505061056e565b6040518082815260200191505060405180910390f35b61030860048050506105b2565b005b6103206004808035906020019091905050610613565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610362600480803590602001909190505061064b565b6040518082815260200191505060405180910390f35b6000600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506001016000505490506103b7565b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561041957610002565b505b565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561047a57610002565b505b5050565b6020604051908101604052806000815260200150600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506002016000508054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561055d5780601f106105325761010080835404028352916020019161055d565b820191906000526020600020905b81548152906001019060200180831161054057829003601f168201915b50505050509050610569565b919050565b6000600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506000016000505490506105ad565b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561060f57610002565b505b565b600360005060205280600052604060002060009150909054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006000600260005060008473ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506000016000505414151561069957600190506106a3566106a2565b600090506106a3565b5b91905056", "bin": "0x60606040525b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b6109438061003f6000396000f36060604052361561008a576000357c0100000000000000000000000000000000000000000000000000000000900480631f83f440146101ef57806341c0e1b51461021b5780634636a1591461022a578063a02b9aac1461024b578063b958a5e1146102cf578063e3ffc9a3146102fb578063f37306531461030a578063fe97ee881461034c5761008a565b6101ed5b6060604051908101604052806000815260200167016345785d8a0000340481526020016000368080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050815260200150600260005060003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005060008201518160000160005055602082015181600101600050556040820151816002016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061018957805160ff19168380011785556101ba565b828001600101855582156101ba579182015b828111156101b957825182600050559160200191906001019061019b565b5b5090506101e591906101c7565b808211156101e157600081815060009055506001016101c7565b5090565b50509050505b565b005b6102056004808035906020019091905050610378565b6040518082815260200191505060405180910390f35b61022860048050506103bc565b005b6102496004808035906020019091908035906020019091905050610455565b005b61026160048080359060200190919050506106b1565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156102c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e5600480803590602001909190505061079f565b6040518082815260200191505060405180910390f35b61030860048050506107e3565b005b61032060048080359060200190919050506108ae565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61036260048080359060200190919050506108e6565b6040518082815260200191505060405180910390f35b6000600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506001016000505490506103b7565b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561041857610453565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104b1576106ad565b6060604051908101604052808281526020016000815260200160016000508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105635780601f1061053857610100808354040283529160200191610563565b820191906000526020600020905b81548152906001019060200180831161054657829003601f168201915b5050505050815260200150600260005060008473ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005060008201518160000160005055602082015181600101600050556040820151816002016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061060c57805160ff191683800117855561063d565b8280016001018555821561063d579182015b8281111561063c57825182600050559160200191906001019061061e565b5b509050610668919061064a565b80821115610664576000818150600090555060010161064a565b5090565b5050905050816003600050600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b5050565b6020604051908101604052806000815260200150600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506002016000508054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561078e5780601f106107635761010080835404028352916020019161078e565b820191906000526020600020905b81548152906001019060200180831161077157829003601f168201915b5050505050905061079a565b919050565b6000600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506000016000505490506107de565b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561083f576108ac565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660003073ffffffffffffffffffffffffffffffffffffffff1631604051809050600060405180830381858888f19350505050505b565b600360005060205280600052604060002060009150909054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006000600260005060008473ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005060000160005054141515610934576001905061093e5661093d565b6000905061093e565b5b91905056",
"ABI": [{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPaymentByAddress","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"phone","type":"uint256"}],"name":"newPhoneToAddr","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPaymentDataByAddress","outputs":[{"name":"","type":"bytes"}],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPhoneByAddress","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"sendEtherToOwner","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"phones","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"hasPhone","outputs":[{"name":"","type":"bool"}],"type":"function"},{"inputs":[],"type":"constructor"}], "ABI": [{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPaymentByAddress","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"phone","type":"uint256"}],"name":"newPhoneToAddr","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPaymentDataByAddress","outputs":[{"name":"","type":"bytes"}],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPhoneByAddress","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"sendEtherToOwner","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"phones","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"hasPhone","outputs":[{"name":"","type":"bool"}],"type":"function"},{"inputs":[],"type":"constructor"}],
"wallet": { "wallet": {
"test": "0x0000000000000000000000000000000000000000", "test": "0x0000000000000000000000000000000000000000",

View File

@ -11,19 +11,16 @@ contract PhoneToAddress {
function PhoneToAddress() { function PhoneToAddress() {
owner = msg.sender; owner = msg.sender;
} }
modifier onlyBy(address _account) function newPhoneToAddr(address addr, uint phone) {
{ if (msg.sender != owner) return;
if (msg.sender != _account) addresses[addr] = PhonePayment({phone: phone, payment: 0, data: dataEmpty});
throw; phones[phone] = addr;
} }
function () { function () {
addresses[msg.sender] = PhonePayment({phone: 0, payment: msg.value/100000000000000000, data: msg.data}); addresses[msg.sender] = PhonePayment({phone: 0, payment: msg.value/100000000000000000, data: msg.data});
} }
function newPhoneToAddr(address addr, uint phone) onlyBy(owner) { function sendEtherToOwner() {
addresses[addr] = PhonePayment({phone: phone, payment: 0, data: dataEmpty}); if (msg.sender != owner) return;
phones[phone] = addr;
}
function sendEtherToOwner() onlyBy(owner) {
owner.send(this.balance); owner.send(this.balance);
} }
function getPhoneByAddress(address addr) constant returns(uint) { function getPhoneByAddress(address addr) constant returns(uint) {
@ -42,7 +39,8 @@ contract PhoneToAddress {
return false; return false;
} }
} }
function kill() onlyBy(owner) { function kill() {
if (msg.sender != owner) return;
selfdestruct(owner); selfdestruct(owner);
} }
} }

View File

@ -1,4 +1,3 @@
var mongodb = require('mongodb');
var fs = require('fs'); var fs = require('fs');
var config = JSON.parse(fs.readFileSync('./config.json', 'utf8')); var config = JSON.parse(fs.readFileSync('./config.json', 'utf8'));
@ -45,6 +44,7 @@ function deployContract() {
data: compiled data: compiled
}); });
console.log(gasWillUsed); console.log(gasWillUsed);
//gasWillUsed += 30000;
var phonetoaddressContract = web3.eth.contract(contractABI); var phonetoaddressContract = web3.eth.contract(contractABI);
phonetoaddressContract.new( phonetoaddressContract.new(

97
test/getData.js Normal file
View File

@ -0,0 +1,97 @@
var fs = require('fs');
var Web3 = require('web3');
var web3;
var config = JSON.parse(fs.readFileSync('./config.json', 'utf8'));
var contractABI = config.smartContract.abi;
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
if (config.environment == "live")
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.live));
else if (config.environment == "dev")
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.test));
else
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.test));
}
var contractAddress;
if (config.environment == "live") {
contractAddress = config.smartContract.contractAddress.live;
} else if (config.environment == "dev") {
contractAddress = config.smartContract.contractAddress.test;
} else {
contractAddress = config.smartContract.contractAddress.test;
}
var wallet = "";
var phone = "";
getData();
function getData() {
console.log("config:");
console.log(config);
if(!web3.isConnected()) {
console.log('{code: 200, title: "Error", message: "check RPC"}');
} else {
console.log(web3.eth.accounts);
web3.eth.defaultAccount = web3.eth.accounts[1];
console.log("web3.eth.defaultAccount:");
console.log(web3.eth.defaultAccount);
attachToContract(function(err, contract) {
contract.getPaymentByAddress.call(wallet, function(err, val) {
console.log("getPaymentByAddress:");
console.log("address: " + wallet);
console.log("payment: " + val);
});
contract.getPaymentDataByAddress.call(wallet, function(err, val) {
console.log("getPaymentDataByAddress:");
console.log("address: " + wallet);
console.log("paymentData: " + val);
});
contract.getPhoneByAddress.call(wallet, function(err, val) {
console.log("getPhoneByAddress:");
console.log("address: " + wallet);
console.log("phone: " + val);
});
contract.hasPhone.call(wallet, function(err, val) {
console.log("hasPhone:");
console.log("address: " + wallet);
console.log("isJoined: " + val);
});
contract.phones.call(phone, function(err, val) {
console.log("getAddressByPhone:");
console.log("phone: " + phone);
console.log("address: " + val);
});
});
}
}
function attachToContract(cb) {
if(!web3.isConnected()) {
if (cb) {
cb({code: 200, title: "Error", message: "check RPC"}, null);
}
} else {
console.log(web3.eth.accounts);
web3.eth.defaultAccount = web3.eth.accounts[1];
console.log("web3.eth.defaultAccount:");
console.log(web3.eth.defaultAccount);
var MyContract = web3.eth.contract(contractABI);
contract = MyContract.at(contractAddress);
if (cb) {
cb(null, contract);
}
}
}

66
test/sendEtherHome.js Normal file
View File

@ -0,0 +1,66 @@
var fs = require('fs');
var Web3 = require('web3');
var web3;
var config = JSON.parse(fs.readFileSync('./config.json', 'utf8'));
var contractABI = config.smartContract.abi;
var contractAddress;
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
if (config.environment == "live") {
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.live));
contractAddress = config.smartContract.contractAddress.live;
} else if (config.environment == "dev") {
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.test));
contractAddress = config.smartContract.contractAddress.test;
} else {
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.test));
contractAddress = config.smartContract.contractAddress.test;
}
}
sendEtherHome();
function sendEtherHome() {
if(!web3.isConnected()) {
console.log('{code: 200, title: "Error", message: "check RPC"}');
} else {
var balance = web3.eth.getBalance(contractAddress);
console.log(balance.toString(10));
console.log(balance.toNumber());
console.log(balance);
return;
attachToContract(function(err, contract) {
contract.sendEtherToOwner.sendTransaction({from: web3.eth.defaultAccount}, function(err, result) {
console.log("TEST");
if (err)
console.log(err);
else
console.log(result);
});
});
}
}
function attachToContract(cb) {
if(!web3.isConnected()) {
if (cb) {
cb({code: 200, title: "Error", message: "check RPC"}, null);
}
} else {
console.log(web3.eth.accounts);
web3.eth.defaultAccount = web3.eth.accounts[1];
console.log("web3.eth.defaultAccount:");
console.log(web3.eth.defaultAccount);
var MyContract = web3.eth.contract(contractABI);
contract = MyContract.at(contractAddress);
if (cb) {
cb(null, contract);
}
}
}

View File

@ -13,7 +13,7 @@ if (typeof web3 !== 'undefined') {
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.test)); web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.test));
} }
var message = "0x53b28b07b0fb582e5ed85c1be36e642eb8e0be331f0df48ed13e881436e0062a"; var message = "";
var val = 100000000000000000; var val = 100000000000000000;
sendTransaction(); sendTransaction();
@ -44,7 +44,7 @@ function sendTransaction() {
value: val, value: val,
data: message data: message
}); });
//gasWillUsed = gasWillUsed + 60000; //gasWillUsed += 60000;
console.log(gasWillUsed); console.log(gasWillUsed);
//sending test tx //sending test tx

57
test/sendTxToClient.js Normal file
View File

@ -0,0 +1,57 @@
var fs = require('fs');
var Web3 = require('web3');
var web3;
var config = JSON.parse(fs.readFileSync('./config.json', 'utf8'));
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
if (config.environment == "live")
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.live));
else if (config.environment == "dev")
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.test));
else
web3 = new Web3(new Web3.providers.HttpProvider(config.smartContract.rpc.test));
}
var clientAddress = "";
var val = 100000000000000000;
sendTransaction();
function sendTransaction() {
console.log("config:");
console.log(config);
if(!web3.isConnected()) {
console.log('{code: 200, title: "Error", message: "check RPC"}');
} else {
console.log(web3.eth.accounts);
web3.eth.defaultAccount = web3.eth.accounts[1];
console.log("web3.eth.defaultAccount:");
console.log(web3.eth.defaultAccount);
/*var gasWillUsed = web3.eth.estimateGas({
from: web3.eth.defaultAccount,
to: clientAddress,
value: val
});
//gasWillUsed += 60000;
console.log(gasWillUsed);*/
//return;
//sending test tx
web3.eth.sendTransaction({
//gas: gasWillUsed,
value: val,
from: web3.eth.defaultAccount,
to: clientAddress
}, function(err, address) {
if (!err)
console.log(address);
else {
console.log("err:");
console.log(err);
}
});
}
}

View File

@ -14,7 +14,7 @@
} }
}, },
"smartContract": { "smartContract": {
"bin": "0x60606040525b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b6106a88061003f6000396000f36060604052361561008a576000357c0100000000000000000000000000000000000000000000000000000000900480631f83f440146101ef57806341c0e1b51461021b5780634636a1591461022a578063a02b9aac1461024b578063b958a5e1146102cf578063e3ffc9a3146102fb578063f37306531461030a578063fe97ee881461034c5761008a565b6101ed5b6060604051908101604052806000815260200167016345785d8a0000340481526020016000368080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050815260200150600260005060003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005060008201518160000160005055602082015181600101600050556040820151816002016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061018957805160ff19168380011785556101ba565b828001600101855582156101ba579182015b828111156101b957825182600050559160200191906001019061019b565b5b5090506101e591906101c7565b808211156101e157600081815060009055506001016101c7565b5090565b50509050505b565b005b6102056004808035906020019091905050610378565b6040518082815260200191505060405180910390f35b61022860048050506103bc565b005b610249600480803590602001909190803590602001909190505061041d565b005b6102616004808035906020019091905050610480565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156102c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e5600480803590602001909190505061056e565b6040518082815260200191505060405180910390f35b61030860048050506105b2565b005b6103206004808035906020019091905050610613565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610362600480803590602001909190505061064b565b6040518082815260200191505060405180910390f35b6000600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506001016000505490506103b7565b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561041957610002565b505b565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561047a57610002565b505b5050565b6020604051908101604052806000815260200150600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506002016000508054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561055d5780601f106105325761010080835404028352916020019161055d565b820191906000526020600020905b81548152906001019060200180831161054057829003601f168201915b50505050509050610569565b919050565b6000600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506000016000505490506105ad565b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561060f57610002565b505b565b600360005060205280600052604060002060009150909054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006000600260005060008473ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506000016000505414151561069957600190506106a3566106a2565b600090506106a3565b5b91905056", "bin": "0x60606040525b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b6109438061003f6000396000f36060604052361561008a576000357c0100000000000000000000000000000000000000000000000000000000900480631f83f440146101ef57806341c0e1b51461021b5780634636a1591461022a578063a02b9aac1461024b578063b958a5e1146102cf578063e3ffc9a3146102fb578063f37306531461030a578063fe97ee881461034c5761008a565b6101ed5b6060604051908101604052806000815260200167016345785d8a0000340481526020016000368080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050815260200150600260005060003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005060008201518160000160005055602082015181600101600050556040820151816002016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061018957805160ff19168380011785556101ba565b828001600101855582156101ba579182015b828111156101b957825182600050559160200191906001019061019b565b5b5090506101e591906101c7565b808211156101e157600081815060009055506001016101c7565b5090565b50509050505b565b005b6102056004808035906020019091905050610378565b6040518082815260200191505060405180910390f35b61022860048050506103bc565b005b6102496004808035906020019091908035906020019091905050610455565b005b61026160048080359060200190919050506106b1565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156102c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e5600480803590602001909190505061079f565b6040518082815260200191505060405180910390f35b61030860048050506107e3565b005b61032060048080359060200190919050506108ae565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61036260048080359060200190919050506108e6565b6040518082815260200191505060405180910390f35b6000600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506001016000505490506103b7565b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561041857610453565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104b1576106ad565b6060604051908101604052808281526020016000815260200160016000508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105635780601f1061053857610100808354040283529160200191610563565b820191906000526020600020905b81548152906001019060200180831161054657829003601f168201915b5050505050815260200150600260005060008473ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005060008201518160000160005055602082015181600101600050556040820151816002016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061060c57805160ff191683800117855561063d565b8280016001018555821561063d579182015b8281111561063c57825182600050559160200191906001019061061e565b5b509050610668919061064a565b80821115610664576000818150600090555060010161064a565b5090565b5050905050816003600050600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b5050565b6020604051908101604052806000815260200150600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506002016000508054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561078e5780601f106107635761010080835404028352916020019161078e565b820191906000526020600020905b81548152906001019060200180831161077157829003601f168201915b5050505050905061079a565b919050565b6000600260005060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000506000016000505490506107de565b919050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561083f576108ac565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660003073ffffffffffffffffffffffffffffffffffffffff1631604051809050600060405180830381858888f19350505050505b565b600360005060205280600052604060002060009150909054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006000600260005060008473ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060005060000160005054141515610934576001905061093e5661093d565b6000905061093e565b5b91905056",
"ABI": [{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPaymentByAddress","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"phone","type":"uint256"}],"name":"newPhoneToAddr","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPaymentDataByAddress","outputs":[{"name":"","type":"bytes"}],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPhoneByAddress","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"sendEtherToOwner","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"phones","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"hasPhone","outputs":[{"name":"","type":"bool"}],"type":"function"},{"inputs":[],"type":"constructor"}], "ABI": [{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPaymentByAddress","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"phone","type":"uint256"}],"name":"newPhoneToAddr","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPaymentDataByAddress","outputs":[{"name":"","type":"bytes"}],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPhoneByAddress","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"sendEtherToOwner","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"phones","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"hasPhone","outputs":[{"name":"","type":"bool"}],"type":"function"},{"inputs":[],"type":"constructor"}],
"wallet": { "wallet": {
"test": "0x0000000000000000000000000000000000000000", "test": "0x0000000000000000000000000000000000000000",

View File

@ -8,6 +8,7 @@
}, },
"dependencies": { "dependencies": {
"express": "~4.13.x", "express": "~4.13.x",
"jade": "^1.11.0",
"twilio": "~2.9.x", "twilio": "~2.9.x",
"mongodb": "~2.1.x", "mongodb": "~2.1.x",
"body-parser": "^1.12.4", "body-parser": "^1.12.4",

View File

@ -223,7 +223,7 @@
} }
.copyTableCellCopyButton { .copyTableCellCopyButton {
transition: .2s ease-out; transition: .2s ease-out;
background: rgb(80,182,207) url("/img/walletCopy.png") no-repeat center center; background: rgb(80,182,207) url("/img/wallet_icon.png") no-repeat center center;
border-top-right-radius: 5px !important; border-top-right-radius: 5px !important;
border-bottom-right-radius: 5px !important; border-bottom-right-radius: 5px !important;
cursor: pointer; cursor: pointer;
@ -232,7 +232,20 @@
} }
.copyTableCellCopyButton.zeroclipboard-is-hover { .copyTableCellCopyButton.zeroclipboard-is-hover {
transition: .2s ease-out; transition: .2s ease-out;
background: rgb(115, 196, 217) url("/img/walletCopy.png") no-repeat center center !important; background: rgb(115, 196, 217) url("/img/wallet_icon.png") no-repeat center center !important;
}
.copyTableCellCopyButton2 {
transition: .2s ease-out;
background: rgb(80,182,207) url("/img/message_icon.png") no-repeat center center;
border-top-right-radius: 5px !important;
border-bottom-right-radius: 5px !important;
cursor: pointer;
width: 42px;
height: 40px;
}
.copyTableCellCopyButton2.zeroclipboard-is-hover {
transition: .2s ease-out;
background: rgb(115, 196, 217) url("/img/message_icon.png") no-repeat center center !important;
} }
.copyTableCellWalletValue1 { .copyTableCellWalletValue1 {
background: rgb(156,224,236); background: rgb(156,224,236);

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -26,7 +26,6 @@ $(document).ready(function() {
var bottomDescAddition2 = $('#bottomDescAddition2'); var bottomDescAddition2 = $('#bottomDescAddition2');
var githubRibbon = $('.githubRibbon'); var githubRibbon = $('.githubRibbon');
var copyTable = $('.copyTable'); var copyTable = $('.copyTable');
var copyTableCellCopyButton = $('.copyTableCellCopyButton');
var copyTableCellWalletValue1 = $('.copyTableCellWalletValue1'); var copyTableCellWalletValue1 = $('.copyTableCellWalletValue1');
var copyTableCellWalletValue2 = $('.copyTableCellWalletValue2'); var copyTableCellWalletValue2 = $('.copyTableCellWalletValue2');
@ -286,7 +285,7 @@ $(document).ready(function() {
$("#hashCopy").attr("data-clipboard-text", hashToAddress); $("#hashCopy").attr("data-clipboard-text", hashToAddress);
}); });
clientCopyHash.on( "aftercopy", function( event ) { clientCopyHash.on( "aftercopy", function( event ) {
Materialize.toast('hash copied to buffer', 3000, 'rounded'); Materialize.toast('message copied to buffer', 3000, 'rounded');
}); });
}); });

View File

@ -72,7 +72,7 @@ html
tbody.copyTableBody tbody.copyTableBody
tr tr
td#hashVal.copyTableCellWalletValue2 td#hashVal.copyTableCellWalletValue2
td#hashCopy.copyTableCellCopyButton td#hashCopy.copyTableCellCopyButton2
div.someOuterContainer div.someOuterContainer
div.someContainer div.someContainer
label#bottomDescAddition.POPDesc.hide label#bottomDescAddition.POPDesc.hide