geth
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* [[geth]] [#hd342b09]
#contents
[[Download Geth >https://geth.ethereum.org/downloads/]]よ...
実行~
毎回unlockは面倒だから,2つのアカウントはpasswordファイル...
geth --unlock 0,1 --password c:\gethdata\pass.txt --mine...
mineとかminerthreadsとか指定しているけど、省略してコンソ...
>miner.start(1)
null
>eth.mining
true
>miner.stop()
true
でもよし
**コマンド [#ja9545e2]
***アカウント作成 [#jf5d561d]
personal.newAccount("test1")
***アカウント一覧 [#i5005558]
eth.accounts
***マイニングするアカウントの確認 [#o3153b15]
eth.coinbase
***送金 [#e404ba13]
eth.sendTransaction({from:eth.accounts[0],to:eth.account...
とか
var tx = {from:eth.accounts[0],to:eth.accounts[1],value:...
personal.sendTransaction(tx, "passphrase")
passphraseにはfromのパスワード
***残高 [#n23cce39]
web3.fromWei(eth.getBalance(eth.accounts[1]),"ether")
***アンロック アンロックの時間はデフォルト300秒 [#qc01fe66]
personal.unlockAccount(アドレス, "パスワード", "アンロッ...
personal.unlockAccount(アドレス)
***トランザクション確認 #送金でトランザクションIDが表示さ...
eth.getTransaction('トランザクションID')
***トランザクションレシート [#u2085276]
トランザクションが発行されて、マイニングが行われたら、確...
eth.getTransactionReceipt('トランザクションID')
***ブロック確認 [#e03e4cc1]
eth.getBlock(ブロック番号);
***ブロックの中身を取得 [#pf008a01]
eth.getTransactionFromBlock()
***ペンディングトランザクションを確認 [#xf6bbc90]
送金処理が完了しブロックに取り込まれると発行
eth.pendingTransactions
***ハッシュレート [#e5e905c3]
eth.hashrate
***トランザクションのトレース [#te4e8a29]
なんかわかるかも
debug.traceTransaction('アドレス');
こんな感じでfailedの情報が表示されていた。
{
failed: false,
gas: 61484,
接続数確認
net.peerCount
**meteor [#pa33047f]
ここでは関係ないです。ただのフレームワーク。後で分けます..~
bootstrapとsessionはどうでもいいけど、いつもつかっている...
meteor add twbs:bootstrap
meteor add ethereum:web3
meteor add ethereum:accounts
meteor add ethereum:blocks
meteor add session
**EthAccounts [#gc283b26]
meteorのethereum:accounts~
1番目のアカウントの名前
EthAccounts.find().fetch()[0].name
1番目のアカウントのアドレス
EthAccounts.find().fetch()[0].address
1番目のアカウントのEtherの残高
EthAccounts.find().fetch()[0].balance
**EthBlocks [#b1f85ebb]
meteorのethereum:blocks~
最新のブロック番号
EthBlocks.latest.number
最新ブロックのハッシュ値
EthBlocks.latest.hash
最新ブロックを採掘した採掘者のアドレス
EthBlocks.latest.miner
**truffle [#q96f89da]
イーサリアムの開発フレームワークです。まずはインストール
npm install -g truffle
以下のサイトを参考~
参考[[Ethereumアプリの開発フレームワークTruffle入門>http:...
参考[[【イーサリアム】 SolidityとTruffleでペットショップ...
エラーでたら、とりあえず
npm install --global windows-build-tools
OpenZeppelinライブラリを入れて、
npm i zeppelin-solidity
truffle develop
でコンソールに入って
compile
migrate
作ったコントラクトは、コンソールの中で、使える。
var tt = コントラクト.at(TutorialToken.address)
tt.transfer(web3.eth.accounts[2], 10e18)
コントラクト.deployed()
とやると、ABIが見える。app.jsとかをみてると、
deployed().then
とかあるけど、truffle-contract.jsに
deployed: function()
があった。thenがいるから、Promiseなんだろうな。
***Error: Could not find C:\dapps\hoge\node_modules\zeppe...
import "../node_modules/zeppelin-solidity/contracts/toke...
にしてやる。ようはディレクトリ階層が違っていると当然駄目。
***Error: VM Exception while processing transaction: reve...
tt.transfer(web3.eth.accounts[2], 10e18)
でrevertされまくり。totalSupply_に15000とか小さい値を設定...
ちなみにWEBでひっかかるサンプルのソースのコンストラクタで...
zeppelin-solidity/contracts/token/ERC20/BasicToken.solを...
追記~
truffle developで
tt.transfer(web3.eth.accounts[4],8,{from:web3.eth.accoun...
これでもエラーが発生。うまくいくaccountもあり調べると
truffle(develop)> tt.balanceOf(web3.eth.accounts[1])
BigNumber { s: 1, e: 0, c: [ 5 ] }
で8 > 5になっていた。
tt.transfer(web3.eth.accounts[4],5,{from:web3.eth.accoun...
にするとうまくいき、
truffle(develop)> tt.balanceOf(web3.eth.accounts[1])
BigNumber { s: 1, e: 0, c: [ 0 ] }
となった。~
token/ERC20/BasicToken.solのfunction transferで
require(_value <= balances[msg.sender]);
となっているので、当然だった..
***Error: VM Exception while processing transaction: reve...
pragma solidity ^0.4.18;
import "../node_modules/zeppelin-solidity/contracts/toke...
contract TestCoin is MintableToken {
string public name = "TEST COIN";
string public symbol = "TST";
uint8 public decimals = 18;
}
としていたが、
contract TestCoin is MintableToken {
string public name = "TEST COIN";
string public symbol = "TST";
uint8 public decimals = 18;
uint public INITIAL_SUPPLY = 15000e18;
function ArayaCoin() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
としてみた。
**Browser-Solidity エラー [#cd7ab2d3]
***errored: Error encoding arguments: SyntaxError: Unexpe...
setMsg1とかでtestとかをセットしてやるとエラー。"test"とす...
***Warning: No visibility specified. Defaulting to "publi...
function Hoge() public {
とpublicをつける
***Warning: "throw" is deprecated in favour of "revert()"...
throwは使うなということらしい。
if(!owner.send(this.balance)) {
throw;
}
を
require(owner.send(this.balance));
にする。
***ParserError: Expected token Semicolon got 'Identifier'...
require(investors[i].addr.send(investors[i].amount))
i++
はrequireの最後に;が抜けていた...
require(investors[i].addr.send(investors[i].amount));
i++
***Warning: Variable is declared as a storage pointer. Us...
[[【Solidity基礎】storageとmemory>https://tomokazu-kozuma...
Investor storage inv = investors[numInvestors++];
***Warning: Function state mutability can be restricted t...
function getAdopters() public returns (address[16]) {
でワーニング
function getAdopters() public view returns (address[16]) {
に変更
[[【Ethereum】【Solidity0.4.16】viewとpure修飾子>https://...
***Error: Attempting to run transaction which calls a con...
これはtruffleでmigrateした時のエラーです。build/contracts...
***Warning: Using contract member "balance" inherited fro...
to.transfer(this.balance);
を
to.transfer(address(this).balance);
に修正
*** "sha3" has been deprecated in favour of "keccak256" [...
sha3をkeccak256に書き換える
***Function with same name and arguments defined twice. [...
function () public {
}
function () payable public {
}
どっちかにしろってこと。
***base fee exceeds gas limit [#yd13089b]
intrinsic gas too lowと表示されることもあるらしいのですが...
** 調査 [#d9f57302]
***fallback [#v138787e]
function () public payable {
の場合、
eth.sendTransaction({to:rp.address,from:eth.accounts[0],...
でコントラクトに送ると、実行されている。rpは
var rp = eth.constract(....
で設定している。
function () public {
とすると、実行されない。payableがついている関数はsendTran...
eth.sendTransaction({from:rp.address,to:eth.accounts[0],...
fromtoを逆にすると、これはエラーになる。コントラクトから...
function transfer(address to, uint256 value) public {
to.transfer(value);
}
を作って、
rp.transfer.sendTransaction(eth.accounts[1],web3.toWei(5...
で送れた。[[zeppelin-solidity>https://openzeppelin.org/]]...
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (ui...
function transfer(address to, uint256 value) public ret...
event Transfer(address indexed from, address indexed to...
}
ってなっており、BasicToken.solでtransferの実装をしている...
***補完してくれない。 [#o352e3d6]
gethでタブで補完してくれるのだが、
var r4 = eth.contract(....
とかで作成しても、r4.でタブを押しても補完してくれない。
var rf = eth.contract(....
とか数値以外にすると、rf.でタブで、
rf._eth rf.adpsender rf.cntfallback ...
rf.abi rf.allEvents rf.constructor ...
rf.address rf.amount rf.deposit ...
とか補完してくれる...
***MetaMaskで失敗する。 [#ffa4130c]
truffle unbox tutorialtoken
で作ったやつで、[[OpenZeppelinを活用してセキュアのコント...
を参考にやってみたのだが、
tt.transfer(web3.eth.accounts[3], 600e18)
した後でないと、MetaMaskでエラーがでる。
vm exception while processing transaction:revert
なぜだ...→単純に元のbalanceが0だったのでした...
** TIPS [#u718817d]
***コマンド [#n7828c90]
[[Ethereum Geth コンソールコマンド一覧>https://qiita.com/...
***Browser-Solidity [#n44aaccb]
[[browser-solidity>https://ethereum.github.io/browser-sol...
なんかlocalにコネクトができなくなった...なので、~
[[https://remix.ethereum.org/]]~
からダイレクトに使ってます。
***Web3 JavaScript app API [#i624d05e]
web3.eth.hashrateとかどんなのがあるかみたい時に。~
[[Web3 JavaScript app API for 0.2x.x>https://github.com/e...
***Stringの比較 [#ne8bc504]
if (keccak256("hoge1") == keccak256("hoge2")) {
とする。
if ("hoge1" == "hoge2") {
ではなく、ハッシュ値で比較。
*** 'is' keyword [#tff2afbe]
Solidityでcontract A Is Bとかあるんだけど、Inheritanceな...
インターフェイスではなかったのですね。~
例)
contract StandardToken is ERC20, BasicToken {
参考:[[Solidity in Depth » Contracts>http://solidity.rea...
***payable [#jeb0e5b8]
Solidityのpayable modifier はETH の送金処理を受け取る際に...
***BigNumber [#vd6ba3ef]
truffle(develop)> var balance = new web3.BigNumber('123...
undefined
truffle(develop)> balance.toString()
'1234567890.1234567890123456789'
truffle(develop)> balance
BigNumber { s: 1, e: 9, c: [ 1234567890, 12345678901234,...
sとかeはなんなんやろ... s + eが整数の桁数ぽいが...
***pureとview [#s58be52d]
view:データの読み取り専用で編集できない
function hoge() public view returns (string) {
pure:この関数の中の値しか使えない。つまり戻り値が関数の...
function hoge() public pure returns (string) {
** リンク [#u3762743]
[[ブロックチェーンの基本的な仕組み>https://blockchain-jp....
[[git>https://git-scm.com/download/win]]~
[[[Japanese] Meteorを使ってDappを作ろう>https://github.co...
[[ガスと取引コスト: Gas Limit と Gas Price とは?>http://b...
[[技術者向け Ethereum(イーサリアム)の基礎知識>http://bloc...
[[【Solidity基礎】storageとmemory>https://tomokazu-kozuma...
[[【Solidity基礎】modifier修飾子について>https://tomokazu...
[[【Solidity基礎】view、pure関数修飾子>https://tomokazu-k...
[[Solidity 言語仕様 コントラクト篇>https://qiita.com/blu...
constantとか調べさせていただきました。~
[[ganache>http://truffleframework.com/ganache/]]~
[[Web開発者がスマートコントラクト開発で戸惑いがちなポイン...
[[Truffle: Contract.call()が返すのはPromiseなのでハマった...
crowdsale.token().then(addr => { tokenAddress = addr } )
と
var tokenAddress = crowdsale.token();
ではまりました...
どちらも
truffle(develop)> tokenAddress
'0xf2beae25b23f0ccdd234410354cb42d08ed54981'
と同じ値を返すくせに前者は、
truffle(develop)> tokenAddress.toString()
'0xf2beae25b23f0ccdd234410354cb42d08ed54981'
で後者は、
truffle(develop)> tokenAddress.toString()
'[object Promise]'
になっていた...~
[[【Solidity基礎】型の種類>https://tomokazu-kozuma.com/da...
[[EthereumのsendTransaction時のvalidationエラー一覧>http:...
[[EthereumのBest Practiceが適用されたICO Crowdsale(クラウ...
[[Ethereumテストネット上でクラウドセール(Crowdsale)を開催...
[[Truffle で始める Ethereum 入門 - ERC20 トークンを作って...
とても丁寧に説明されています。solidityも0.4.18です。~
[[ContractのEventの仕組み>http://y-nakajo.hatenablog.com/...
EventはTransactionReceiptのLogに書き込まれるのか。~
[[Ropstenのテストネット上でERC20トークンを作成・送付して...
そのうちやってみよう。~
[[テストネットRopstenで1ETHをもらう>https://qiita.com/ben...
[[どんぐりコインを作ってみた>https://dongri.github.io/201...
これもそのうちやってみる。live環境にデプロイってやつ。~
[[BATトークンのスマートコントラクトを全行コメント解説>htt...
ソースにコメントがあるので、ありがたい!~
[[ERC-20 Token Standard に準拠した独自トークンを自前実装...
上と同様にコメントがあり、助かります!後、approveとかわか...
[[イーサリアム上のDApp開発をゲームを作って学びましょう>ht...
むちゃくちゃよく出来ている!~
** 参考書籍 [#i8720c14]
[[Ethereum入門>https://book.ethereum-jp.net/]]
** コメント [#s2a63701]
-#comment
終了行:
* [[geth]] [#hd342b09]
#contents
[[Download Geth >https://geth.ethereum.org/downloads/]]よ...
実行~
毎回unlockは面倒だから,2つのアカウントはpasswordファイル...
geth --unlock 0,1 --password c:\gethdata\pass.txt --mine...
mineとかminerthreadsとか指定しているけど、省略してコンソ...
>miner.start(1)
null
>eth.mining
true
>miner.stop()
true
でもよし
**コマンド [#ja9545e2]
***アカウント作成 [#jf5d561d]
personal.newAccount("test1")
***アカウント一覧 [#i5005558]
eth.accounts
***マイニングするアカウントの確認 [#o3153b15]
eth.coinbase
***送金 [#e404ba13]
eth.sendTransaction({from:eth.accounts[0],to:eth.account...
とか
var tx = {from:eth.accounts[0],to:eth.accounts[1],value:...
personal.sendTransaction(tx, "passphrase")
passphraseにはfromのパスワード
***残高 [#n23cce39]
web3.fromWei(eth.getBalance(eth.accounts[1]),"ether")
***アンロック アンロックの時間はデフォルト300秒 [#qc01fe66]
personal.unlockAccount(アドレス, "パスワード", "アンロッ...
personal.unlockAccount(アドレス)
***トランザクション確認 #送金でトランザクションIDが表示さ...
eth.getTransaction('トランザクションID')
***トランザクションレシート [#u2085276]
トランザクションが発行されて、マイニングが行われたら、確...
eth.getTransactionReceipt('トランザクションID')
***ブロック確認 [#e03e4cc1]
eth.getBlock(ブロック番号);
***ブロックの中身を取得 [#pf008a01]
eth.getTransactionFromBlock()
***ペンディングトランザクションを確認 [#xf6bbc90]
送金処理が完了しブロックに取り込まれると発行
eth.pendingTransactions
***ハッシュレート [#e5e905c3]
eth.hashrate
***トランザクションのトレース [#te4e8a29]
なんかわかるかも
debug.traceTransaction('アドレス');
こんな感じでfailedの情報が表示されていた。
{
failed: false,
gas: 61484,
接続数確認
net.peerCount
**meteor [#pa33047f]
ここでは関係ないです。ただのフレームワーク。後で分けます..~
bootstrapとsessionはどうでもいいけど、いつもつかっている...
meteor add twbs:bootstrap
meteor add ethereum:web3
meteor add ethereum:accounts
meteor add ethereum:blocks
meteor add session
**EthAccounts [#gc283b26]
meteorのethereum:accounts~
1番目のアカウントの名前
EthAccounts.find().fetch()[0].name
1番目のアカウントのアドレス
EthAccounts.find().fetch()[0].address
1番目のアカウントのEtherの残高
EthAccounts.find().fetch()[0].balance
**EthBlocks [#b1f85ebb]
meteorのethereum:blocks~
最新のブロック番号
EthBlocks.latest.number
最新ブロックのハッシュ値
EthBlocks.latest.hash
最新ブロックを採掘した採掘者のアドレス
EthBlocks.latest.miner
**truffle [#q96f89da]
イーサリアムの開発フレームワークです。まずはインストール
npm install -g truffle
以下のサイトを参考~
参考[[Ethereumアプリの開発フレームワークTruffle入門>http:...
参考[[【イーサリアム】 SolidityとTruffleでペットショップ...
エラーでたら、とりあえず
npm install --global windows-build-tools
OpenZeppelinライブラリを入れて、
npm i zeppelin-solidity
truffle develop
でコンソールに入って
compile
migrate
作ったコントラクトは、コンソールの中で、使える。
var tt = コントラクト.at(TutorialToken.address)
tt.transfer(web3.eth.accounts[2], 10e18)
コントラクト.deployed()
とやると、ABIが見える。app.jsとかをみてると、
deployed().then
とかあるけど、truffle-contract.jsに
deployed: function()
があった。thenがいるから、Promiseなんだろうな。
***Error: Could not find C:\dapps\hoge\node_modules\zeppe...
import "../node_modules/zeppelin-solidity/contracts/toke...
にしてやる。ようはディレクトリ階層が違っていると当然駄目。
***Error: VM Exception while processing transaction: reve...
tt.transfer(web3.eth.accounts[2], 10e18)
でrevertされまくり。totalSupply_に15000とか小さい値を設定...
ちなみにWEBでひっかかるサンプルのソースのコンストラクタで...
zeppelin-solidity/contracts/token/ERC20/BasicToken.solを...
追記~
truffle developで
tt.transfer(web3.eth.accounts[4],8,{from:web3.eth.accoun...
これでもエラーが発生。うまくいくaccountもあり調べると
truffle(develop)> tt.balanceOf(web3.eth.accounts[1])
BigNumber { s: 1, e: 0, c: [ 5 ] }
で8 > 5になっていた。
tt.transfer(web3.eth.accounts[4],5,{from:web3.eth.accoun...
にするとうまくいき、
truffle(develop)> tt.balanceOf(web3.eth.accounts[1])
BigNumber { s: 1, e: 0, c: [ 0 ] }
となった。~
token/ERC20/BasicToken.solのfunction transferで
require(_value <= balances[msg.sender]);
となっているので、当然だった..
***Error: VM Exception while processing transaction: reve...
pragma solidity ^0.4.18;
import "../node_modules/zeppelin-solidity/contracts/toke...
contract TestCoin is MintableToken {
string public name = "TEST COIN";
string public symbol = "TST";
uint8 public decimals = 18;
}
としていたが、
contract TestCoin is MintableToken {
string public name = "TEST COIN";
string public symbol = "TST";
uint8 public decimals = 18;
uint public INITIAL_SUPPLY = 15000e18;
function ArayaCoin() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
としてみた。
**Browser-Solidity エラー [#cd7ab2d3]
***errored: Error encoding arguments: SyntaxError: Unexpe...
setMsg1とかでtestとかをセットしてやるとエラー。"test"とす...
***Warning: No visibility specified. Defaulting to "publi...
function Hoge() public {
とpublicをつける
***Warning: "throw" is deprecated in favour of "revert()"...
throwは使うなということらしい。
if(!owner.send(this.balance)) {
throw;
}
を
require(owner.send(this.balance));
にする。
***ParserError: Expected token Semicolon got 'Identifier'...
require(investors[i].addr.send(investors[i].amount))
i++
はrequireの最後に;が抜けていた...
require(investors[i].addr.send(investors[i].amount));
i++
***Warning: Variable is declared as a storage pointer. Us...
[[【Solidity基礎】storageとmemory>https://tomokazu-kozuma...
Investor storage inv = investors[numInvestors++];
***Warning: Function state mutability can be restricted t...
function getAdopters() public returns (address[16]) {
でワーニング
function getAdopters() public view returns (address[16]) {
に変更
[[【Ethereum】【Solidity0.4.16】viewとpure修飾子>https://...
***Error: Attempting to run transaction which calls a con...
これはtruffleでmigrateした時のエラーです。build/contracts...
***Warning: Using contract member "balance" inherited fro...
to.transfer(this.balance);
を
to.transfer(address(this).balance);
に修正
*** "sha3" has been deprecated in favour of "keccak256" [...
sha3をkeccak256に書き換える
***Function with same name and arguments defined twice. [...
function () public {
}
function () payable public {
}
どっちかにしろってこと。
***base fee exceeds gas limit [#yd13089b]
intrinsic gas too lowと表示されることもあるらしいのですが...
** 調査 [#d9f57302]
***fallback [#v138787e]
function () public payable {
の場合、
eth.sendTransaction({to:rp.address,from:eth.accounts[0],...
でコントラクトに送ると、実行されている。rpは
var rp = eth.constract(....
で設定している。
function () public {
とすると、実行されない。payableがついている関数はsendTran...
eth.sendTransaction({from:rp.address,to:eth.accounts[0],...
fromtoを逆にすると、これはエラーになる。コントラクトから...
function transfer(address to, uint256 value) public {
to.transfer(value);
}
を作って、
rp.transfer.sendTransaction(eth.accounts[1],web3.toWei(5...
で送れた。[[zeppelin-solidity>https://openzeppelin.org/]]...
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (ui...
function transfer(address to, uint256 value) public ret...
event Transfer(address indexed from, address indexed to...
}
ってなっており、BasicToken.solでtransferの実装をしている...
***補完してくれない。 [#o352e3d6]
gethでタブで補完してくれるのだが、
var r4 = eth.contract(....
とかで作成しても、r4.でタブを押しても補完してくれない。
var rf = eth.contract(....
とか数値以外にすると、rf.でタブで、
rf._eth rf.adpsender rf.cntfallback ...
rf.abi rf.allEvents rf.constructor ...
rf.address rf.amount rf.deposit ...
とか補完してくれる...
***MetaMaskで失敗する。 [#ffa4130c]
truffle unbox tutorialtoken
で作ったやつで、[[OpenZeppelinを活用してセキュアのコント...
を参考にやってみたのだが、
tt.transfer(web3.eth.accounts[3], 600e18)
した後でないと、MetaMaskでエラーがでる。
vm exception while processing transaction:revert
なぜだ...→単純に元のbalanceが0だったのでした...
** TIPS [#u718817d]
***コマンド [#n7828c90]
[[Ethereum Geth コンソールコマンド一覧>https://qiita.com/...
***Browser-Solidity [#n44aaccb]
[[browser-solidity>https://ethereum.github.io/browser-sol...
なんかlocalにコネクトができなくなった...なので、~
[[https://remix.ethereum.org/]]~
からダイレクトに使ってます。
***Web3 JavaScript app API [#i624d05e]
web3.eth.hashrateとかどんなのがあるかみたい時に。~
[[Web3 JavaScript app API for 0.2x.x>https://github.com/e...
***Stringの比較 [#ne8bc504]
if (keccak256("hoge1") == keccak256("hoge2")) {
とする。
if ("hoge1" == "hoge2") {
ではなく、ハッシュ値で比較。
*** 'is' keyword [#tff2afbe]
Solidityでcontract A Is Bとかあるんだけど、Inheritanceな...
インターフェイスではなかったのですね。~
例)
contract StandardToken is ERC20, BasicToken {
参考:[[Solidity in Depth » Contracts>http://solidity.rea...
***payable [#jeb0e5b8]
Solidityのpayable modifier はETH の送金処理を受け取る際に...
***BigNumber [#vd6ba3ef]
truffle(develop)> var balance = new web3.BigNumber('123...
undefined
truffle(develop)> balance.toString()
'1234567890.1234567890123456789'
truffle(develop)> balance
BigNumber { s: 1, e: 9, c: [ 1234567890, 12345678901234,...
sとかeはなんなんやろ... s + eが整数の桁数ぽいが...
***pureとview [#s58be52d]
view:データの読み取り専用で編集できない
function hoge() public view returns (string) {
pure:この関数の中の値しか使えない。つまり戻り値が関数の...
function hoge() public pure returns (string) {
** リンク [#u3762743]
[[ブロックチェーンの基本的な仕組み>https://blockchain-jp....
[[git>https://git-scm.com/download/win]]~
[[[Japanese] Meteorを使ってDappを作ろう>https://github.co...
[[ガスと取引コスト: Gas Limit と Gas Price とは?>http://b...
[[技術者向け Ethereum(イーサリアム)の基礎知識>http://bloc...
[[【Solidity基礎】storageとmemory>https://tomokazu-kozuma...
[[【Solidity基礎】modifier修飾子について>https://tomokazu...
[[【Solidity基礎】view、pure関数修飾子>https://tomokazu-k...
[[Solidity 言語仕様 コントラクト篇>https://qiita.com/blu...
constantとか調べさせていただきました。~
[[ganache>http://truffleframework.com/ganache/]]~
[[Web開発者がスマートコントラクト開発で戸惑いがちなポイン...
[[Truffle: Contract.call()が返すのはPromiseなのでハマった...
crowdsale.token().then(addr => { tokenAddress = addr } )
と
var tokenAddress = crowdsale.token();
ではまりました...
どちらも
truffle(develop)> tokenAddress
'0xf2beae25b23f0ccdd234410354cb42d08ed54981'
と同じ値を返すくせに前者は、
truffle(develop)> tokenAddress.toString()
'0xf2beae25b23f0ccdd234410354cb42d08ed54981'
で後者は、
truffle(develop)> tokenAddress.toString()
'[object Promise]'
になっていた...~
[[【Solidity基礎】型の種類>https://tomokazu-kozuma.com/da...
[[EthereumのsendTransaction時のvalidationエラー一覧>http:...
[[EthereumのBest Practiceが適用されたICO Crowdsale(クラウ...
[[Ethereumテストネット上でクラウドセール(Crowdsale)を開催...
[[Truffle で始める Ethereum 入門 - ERC20 トークンを作って...
とても丁寧に説明されています。solidityも0.4.18です。~
[[ContractのEventの仕組み>http://y-nakajo.hatenablog.com/...
EventはTransactionReceiptのLogに書き込まれるのか。~
[[Ropstenのテストネット上でERC20トークンを作成・送付して...
そのうちやってみよう。~
[[テストネットRopstenで1ETHをもらう>https://qiita.com/ben...
[[どんぐりコインを作ってみた>https://dongri.github.io/201...
これもそのうちやってみる。live環境にデプロイってやつ。~
[[BATトークンのスマートコントラクトを全行コメント解説>htt...
ソースにコメントがあるので、ありがたい!~
[[ERC-20 Token Standard に準拠した独自トークンを自前実装...
上と同様にコメントがあり、助かります!後、approveとかわか...
[[イーサリアム上のDApp開発をゲームを作って学びましょう>ht...
むちゃくちゃよく出来ている!~
** 参考書籍 [#i8720c14]
[[Ethereum入門>https://book.ethereum-jp.net/]]
** コメント [#s2a63701]
-#comment
ページ名: