sudo apt-get update
sudo apt-get install squid
sudo apt-get install apache2-utils
sudo htpasswd /etc/squid/passwd newuser
async function testSign() { | |
let from = currentAccount; | |
let unixTime = new Date().getTime(); | |
let params = [currentAccount + ":" + unixTime, from]; | |
let method = 'personal_sign'; | |
web3.currentProvider.sendAsync( | |
{ | |
method, | |
params, |
package main | |
import ( | |
"fmt" | |
"strings" | |
"net/http" | |
"io/ioutil" | |
"math/rand" | |
"time" | |
) |
pragma solidity ^0.4.18; | |
contract owned { | |
address public owner; | |
function owned() public { | |
owner = msg.sender; | |
} | |
modifier onlyOwner { |
// Referrals: https://github.com/ethereum/EIPs/issues/20 | |
contract ERC20 { | |
function totalSupply() constant returns (uint totalSupply); | |
function balanceOf(address _owner) constant returns (uint balance); | |
function transfer(address _to, uint _value) returns (bool success); | |
function transferFrom(address _from, address _to, uint _value) returns (bool success); | |
function approve(address _spender, uint _value) returns (bool success); | |
function allowance(address _owner, address _spender) constant returns (uint remaining); | |
event Transfer(address indexed _from, address indexed _to, uint _value); | |
event Approval(address indexed _owner, address indexed _spender, uint _value); |
pragma solidity ^0.4.18; | |
contract owned { | |
address public owner; | |
function owned() public { | |
owner = msg.sender; | |
} | |
modifier onlyOwner { |
pragma solidity ^0.4.18; | |
contract MyBitcoin { | |
mapping (address => uint256) public balanceOf; | |
event Transfer(address indexed from, address indexed to, uint256 value); | |
function MyBitcoin(uint256 initialSupply) public{ | |
balanceOf[msg.sender] = initialSupply; | |
} |
pragma solidity ^0.4.18; | |
contract MyBitcoin { | |
/* This creates an array with all balances */ | |
mapping (address => uint256) public balanceOf; | |
/* Initializes contract with initial supply tokens to the creator of the contract */ | |
function MyBitcoin(uint256 initialSupply) public { | |
balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens | |
} |