-
signer -->
0x9a58141b42eebc98446d2567f5edfa38cfee6778
とする。 -
solidity-sha3 使って、文字列(
hogehoge
)のSHAを取得する。 -
nodeにログインして以下の通り実行する。
$ node
> const sha3 = require("solidity-sha3");
> var hash = sha3.sha3num('hogehoge');
> console.log(hash);
pragma solidity ^0.4.24; | |
contract SimpleToken { | |
// (1) 状態変数の宣言 | |
string public name; // トークンの名前 | |
string public symbol; // トークンの単位 | |
uint256 public totalSupply; // トークンの総量 | |
mapping (address => uint256) public balanceOf; // 各アドレスの残高 |
pragma solidity ^0.4.24; | |
contract HelloWorld { | |
string public greeting; | |
constructor(string _greeting) public { | |
greeting = _greeting; | |
} |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from pyquery import PyQuery as pq | |
def main(): | |
# 気象庁 東京 2014年1月データ | |
url = ('http://www.data.jma.go.jp/obd/stats/etrn/view/daily_s1.php?' | |
'prec_no=44&block_no=47662&year=2014&month=1&day=&view=') | |
# pyquery | |
query = pq(url, parser='html') |
pragma solidity ^0.4.8; | |
contract ECVerify { | |
event VerifyResult(bool ret, address indexed addr, address indexed recoverAddress); | |
function verify(bytes32 hash, uint8 v, bytes32 r, bytes32 s, address signer) returns(bool) { | |
bytes memory prefix = "\x19Ethereum Signed Message:\n32"; | |
bytes32 prefixedHash = sha3(prefix, hash); |
0x9a58141b42eebc98446d2567f5edfa38cfee6778 |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from pyquery import PyQuery | |
import json | |
q = PyQuery(url='http://mainichi.jp/select/biz/archive/') | |
url = 'http://mainichi.jp/select/news/' | |
links = [] |