This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input id="eth_tip_value" type="number" value="0.01" step="0.01" min="0"> | |
<a href="#" id="eth_tip_button" onclick="onEthTipButtonClick();"> | |
ETH を送ってこのサイトを応援! | |
</a> | |
<script type="text/javascript"> | |
// 必ず自分の Ethereum ウォレットのアドレスを指定してください。 | |
var ETH_ADDRESS = '0x96e530a7a5fdAf3b041BdB8c3ABF30EeD1621eA9'; | |
// 投げ銭または寄付で受け入れたい Ether のデフォルト値です(ETH 送信時に変更可能です) | |
var ETH_VALUE = '0.01'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="#" id="eth_tip_button" onclick="onEthTipButtonClick();"> | |
ETH を送ってこのサイトを応援! | |
</a> | |
<script type="text/javascript"> | |
// 必ず自分の Ethereum ウォレットのアドレスを指定してください。 | |
var ETH_ADDRESS = '0x96e530a7a5fdAf3b041BdB8c3ABF30EeD1621eA9'; | |
// 投げ銭・寄付として受け入れたい Ether の量です。 | |
var ETH_VALUE = '0.01'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { | |
uint cnt = _receivers.length; | |
// _value に大きな値を渡せば、オーバーフローさせることができる | |
// ここで SafeMath を使っていないのが問題(桁溢れの対処ができていない) | |
uint256 amount = uint256(cnt) * _value; | |
// cnt が 1以上 かつ 20以下 であれば通る | |
require(cnt > 0 && cnt <= 20); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
truffle migrate --network ropsten --reset --dry-run | |
truffle migrate --network ropsten --reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export MNEMONIC="Ethereum Walletのニーモニック" | |
export INFURA_ACCESS_TOKEN="infura.ioのアクセストークン" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HDWalletProvider = require("truffle-hdwallet-provider"); | |
var mnemonic = process.env.MNEMONIC; | |
var infuraAccessToken = process.env.INFURA_ACCESS_TOKEN; | |
module.exports = { | |
networks: { | |
// テストネット用デプロイ設定 | |
ropsten: { | |
provider: function() { | |
return new HDWalletProvider( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install truffle-hdwallet-provider --save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ins id="__pixereum__" style="width:300px;"></ins> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script src="http://pixereum.io/js/web3.min.js"></script> | |
<script src="http://pixereum.io/js/badge.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Wallet = require('ethereumjs-wallet'); | |
var EthUtil = require('ethereumjs-util'); | |
// 既存の privateKey を使用して、wallet インスタンスを取得 | |
const privateKeyBuffer = EthUtil.toBuffer('0x61ce8b95ca5fd6f55cd97ac60817777bdf64f1670e903758ce53efc32c3dffeb'); | |
const wallet = Wallet.fromPrivateKey(privateKeyBuffer); | |
// ウォレットの秘密鍵を取得 | |
const privateKey = wallet.getPrivateKeyString(); | |
console.log(privateKey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install ethereumjs-wallet --save | |
npm install ethereumjs-util --save |