commit
595447ccac
@ -0,0 +1,6 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
echo "Downloading firefox..." |
||||
wget https://ftp.mozilla.org/pub/firefox/releases/58.0/linux-x86_64/en-US/firefox-58.0.tar.bz2 \ |
||||
&& tar xjf firefox-58.0.tar.bz2 |
||||
echo "firefox download complete" |
@ -0,0 +1,8 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
echo "Installing firefox..." |
||||
sudo rm -r /opt/firefox |
||||
sudo mv firefox /opt/firefox58 |
||||
sudo mv /usr/bin/firefox /usr/bin/firefox-old |
||||
sudo ln -s /opt/firefox58/firefox /usr/bin/firefox |
||||
echo "Firefox installed." |
@ -1,6 +1,20 @@ |
||||
node_modules/** |
||||
dist/** |
||||
builds/** |
||||
docs/** |
||||
|
||||
development/bundle.js |
||||
development/states.js |
||||
|
||||
app/scripts/lib/extension-instance.js |
||||
app/scripts/chromereload.js |
||||
|
||||
ui/lib/blockies.js |
||||
|
||||
mascara/src/app/first-time/spinner.js |
||||
mascara/test/jquery-3.1.0.min.js |
||||
|
||||
test/integration/bundle.js |
||||
test/integration/jquery-3.1.0.min.js |
||||
test/integration/helpers.js |
||||
test/integration/lib/first-time.js |
||||
ui/lib/blockies.js |
@ -0,0 +1,24 @@ |
||||
const Config = require('./recipient-blacklist.js') |
||||
|
||||
/** @module*/ |
||||
module.exports = { |
||||
checkAccount, |
||||
} |
||||
|
||||
/** |
||||
* Checks if a specified account on a specified network is blacklisted. |
||||
@param networkId {number} |
||||
@param account {string} |
||||
*/ |
||||
function checkAccount (networkId, account) { |
||||
|
||||
const mainnetId = 1 |
||||
if (networkId !== mainnetId) { |
||||
return |
||||
} |
||||
|
||||
const accountToCheck = account.toLowerCase() |
||||
if (Config.blacklist.includes(accountToCheck)) { |
||||
throw new Error('Recipient is a public account') |
||||
} |
||||
} |
@ -0,0 +1,17 @@ |
||||
module.exports = { |
||||
'blacklist': [ |
||||
// IDEX phisher
|
||||
'0x9bcb0A9d99d815Bb87ee3191b1399b1Bcc46dc77', |
||||
// Ganache default seed phrases
|
||||
'0x627306090abab3a6e1400e9345bc60c78a8bef57', |
||||
'0xf17f52151ebef6c7334fad080c5704d77216b732', |
||||
'0xc5fdf4076b8f3a5357c5e395ab970b5b54098fef', |
||||
'0x821aea9a577a9b44299b9c15c88cf3087f3b5544', |
||||
'0x0d1d4e623d10f9fba5db95830f7d3839406c6af2', |
||||
'0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e', |
||||
'0x2191ef87e392377ec08e7c08eb105ef5448eced5', |
||||
'0x0f4f2ac550a1b4e2280d04c21cea7ebd822934b5', |
||||
'0x6330a553fc93768f612722bb8c2ec78ac90b3bbc', |
||||
'0x5aeda56215b167893e80b4fe645ba6d5bab767de', |
||||
], |
||||
} |
@ -0,0 +1,17 @@ |
||||
const MessageManager = require('./lib/message-manager') |
||||
const PersonalMessageManager = require('./lib/personal-message-manager') |
||||
const TypedMessageManager = require('./lib/typed-message-manager') |
||||
|
||||
class UserActionController { |
||||
|
||||
constructor (opts = {}) { |
||||
|
||||
this.messageManager = new MessageManager() |
||||
this.personalMessageManager = new PersonalMessageManager() |
||||
this.typedMessageManager = new TypedMessageManager() |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
module.exports = UserActionController |
@ -0,0 +1,24 @@ |
||||
const WritableStream = require('readable-stream').Writable |
||||
const promiseToCallback = require('promise-to-callback') |
||||
|
||||
module.exports = createStreamSink |
||||
|
||||
|
||||
function createStreamSink (asyncWriteFn, _opts) { |
||||
return new AsyncWritableStream(asyncWriteFn, _opts) |
||||
} |
||||
|
||||
class AsyncWritableStream extends WritableStream { |
||||
|
||||
constructor (asyncWriteFn, _opts) { |
||||
const opts = Object.assign({ objectMode: true }, _opts) |
||||
super(opts) |
||||
this._asyncWriteFn = asyncWriteFn |
||||
} |
||||
|
||||
// write from incomming stream to state
|
||||
_write (chunk, encoding, callback) { |
||||
promiseToCallback(this._asyncWriteFn(chunk, encoding))(callback) |
||||
} |
||||
|
||||
} |
@ -0,0 +1,71 @@ |
||||
class DiagnosticsReporter { |
||||
|
||||
constructor ({ firstTimeInfo, version }) { |
||||
this.firstTimeInfo = firstTimeInfo |
||||
this.version = version |
||||
} |
||||
|
||||
async reportOrphans (orphans) { |
||||
try { |
||||
return await this.submit({ |
||||
accounts: Object.keys(orphans), |
||||
metadata: { |
||||
type: 'orphans', |
||||
}, |
||||
}) |
||||
} catch (err) { |
||||
console.error('DiagnosticsReporter - "reportOrphans" encountered an error:') |
||||
console.error(err) |
||||
} |
||||
} |
||||
|
||||
async reportMultipleKeyrings (rawKeyrings) { |
||||
try { |
||||
const keyrings = await Promise.all(rawKeyrings.map(async (keyring, index) => { |
||||
return { |
||||
index, |
||||
type: keyring.type, |
||||
accounts: await keyring.getAccounts(), |
||||
} |
||||
})) |
||||
return await this.submit({ |
||||
accounts: [], |
||||
metadata: { |
||||
type: 'keyrings', |
||||
keyrings, |
||||
}, |
||||
}) |
||||
} catch (err) { |
||||
console.error('DiagnosticsReporter - "reportMultipleKeyrings" encountered an error:') |
||||
console.error(err) |
||||
} |
||||
} |
||||
|
||||
async submit (message) { |
||||
try { |
||||
// add metadata
|
||||
message.metadata.version = this.version |
||||
message.metadata.firstTimeInfo = this.firstTimeInfo |
||||
return await postData(message) |
||||
} catch (err) { |
||||
console.error('DiagnosticsReporter - "submit" encountered an error:') |
||||
throw err |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
function postData (data) { |
||||
const uri = 'https://diagnostics.metamask.io/v1/orphanedAccounts' |
||||
return fetch(uri, { |
||||
body: JSON.stringify(data), // must match 'Content-Type' header
|
||||
credentials: 'same-origin', // include, same-origin, *omit
|
||||
headers: { |
||||
'content-type': 'application/json', |
||||
}, |
||||
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
||||
mode: 'cors', // no-cors, cors, *same-origin
|
||||
}) |
||||
} |
||||
|
||||
module.exports = DiagnosticsReporter |
@ -0,0 +1,241 @@ |
||||
const fs = require('fs') |
||||
const path = require('path') |
||||
const async = require('async') |
||||
const promisify = require('pify') |
||||
|
||||
// start(/\.selectors.js/, generateSelectorTest).catch(console.error)
|
||||
// start(/\.utils.js/, generateUtilTest).catch(console.error)
|
||||
startContainer(/\.container.js/, generateContainerTest).catch(console.error) |
||||
|
||||
async function getAllFileNames (dirName) { |
||||
const allNames = (await promisify(fs.readdir)(dirName)) |
||||
const fileNames = allNames.filter(name => name.match(/^.+\./)) |
||||
const dirNames = allNames.filter(name => name.match(/^[^.]+$/)) |
||||
|
||||
const fullPathDirNames = dirNames.map(d => `${dirName}/${d}`) |
||||
const subNameArrays = await promisify(async.map)(fullPathDirNames, getAllFileNames) |
||||
let subNames = [] |
||||
subNameArrays.forEach(subNameArray => { subNames = [...subNames, ...subNameArray] }) |
||||
|
||||
return [ |
||||
...fileNames.map(name => dirName + '/' + name), |
||||
...subNames, |
||||
] |
||||
} |
||||
|
||||
/* |
||||
async function start (fileRegEx, testGenerator) { |
||||
const fileNames = await getAllFileNames('./ui/app') |
||||
const sFiles = fileNames.filter(name => name.match(fileRegEx)) |
||||
|
||||
let sFileMethodNames |
||||
let testFilePath |
||||
async.each(sFiles, async (sFile, cb) => { |
||||
const [, sRootPath, sPath] = sFile.match(/^(.+\/)([^/]+)$/) |
||||
sFileMethodNames = Object.keys(require(__dirname + '/' + sFile)) |
||||
|
||||
testFilePath = sPath.replace('.', '-').replace('.', '.test.') |
||||
|
||||
await promisify(fs.writeFile)( |
||||
`${__dirname}/${sRootPath}tests/${testFilePath}`, |
||||
testGenerator(sPath, sFileMethodNames), |
||||
'utf8' |
||||
) |
||||
}, (err) => { |
||||
console.log(err) |
||||
}) |
||||
|
||||
} |
||||
*/ |
||||
|
||||
async function startContainer (fileRegEx, testGenerator) { |
||||
const fileNames = await getAllFileNames('./ui/app') |
||||
const sFiles = fileNames.filter(name => name.match(fileRegEx)) |
||||
|
||||
async.each(sFiles, async (sFile, cb) => { |
||||
console.log(`sFile`, sFile) |
||||
const [, sRootPath, sPath] = sFile.match(/^(.+\/)([^/]+)$/) |
||||
|
||||
const testFilePath = sPath.replace('.', '-').replace('.', '.test.') |
||||
|
||||
await promisify(fs.readFile)( |
||||
path.join(__dirname, sFile), |
||||
'utf8', |
||||
async (err, result) => { |
||||
if (err) { |
||||
console.log('Error: ', err) |
||||
} else { |
||||
console.log(`result`, result.length) |
||||
const returnObjectStrings = result |
||||
.match(/return\s(\{[\s\S]+?})\n}/g) |
||||
.map(str => { |
||||
return str |
||||
.slice(0, str.length - 1) |
||||
.slice(7) |
||||
.replace(/\n/g, '') |
||||
.replace(/\s\s+/g, ' ') |
||||
|
||||
}) |
||||
const mapStateToPropsAssertionObject = returnObjectStrings[0] |
||||
.replace(/\w+:\s\w+\([\w,\s]+\),/g, str => { |
||||
const strKey = str.match(/^\w+/)[0] |
||||
return strKey + ': \'mock' + str.match(/^\w+/)[0].replace(/^./, c => c.toUpperCase()) + ':mockState\',\n' |
||||
}) |
||||
.replace(/{\s\w.+/, firstLinePair => `{\n ${firstLinePair.slice(2)}`) |
||||
.replace(/\w+:.+,/g, s => ` ${s}`) |
||||
.replace(/}/g, s => ` ${s}`) |
||||
let mapDispatchToPropsMethodNames |
||||
if (returnObjectStrings[1]) { |
||||
mapDispatchToPropsMethodNames = returnObjectStrings[1].match(/\s\w+:\s/g).map(str => str.match(/\w+/)[0]) |
||||
} |
||||
const proxyquireObject = ('{\n ' + result |
||||
.match(/import\s{[\s\S]+?}\sfrom\s.+/g) |
||||
.map(s => s.replace(/\n/g, '')) |
||||
.map((s, i) => { |
||||
const proxyKeys = s.match(/{.+}/)[0].match(/\w+/g) |
||||
return '\'' + s.match(/'(.+)'/)[1] + '\': { ' + (proxyKeys.length > 1 |
||||
? '\n ' + proxyKeys.join(': () => {},\n ') + ': () => {},\n ' |
||||
: proxyKeys[0] + ': () => {},') + ' }' |
||||
}) |
||||
.join(',\n ') + '\n}') |
||||
.replace('{ connect: () => {}, },', `{
|
||||
connect: (ms, md) => { |
||||
mapStateToProps = ms |
||||
mapDispatchToProps = md |
||||
return () => ({}) |
||||
}, |
||||
},`)
|
||||
// console.log(`proxyquireObject`, proxyquireObject);
|
||||
// console.log(`mapStateToPropsAssertionObject`, mapStateToPropsAssertionObject);
|
||||
// console.log(`mapDispatchToPropsMethodNames`, mapDispatchToPropsMethodNames);
|
||||
|
||||
const containerTest = generateContainerTest(sPath, { |
||||
mapStateToPropsAssertionObject, |
||||
mapDispatchToPropsMethodNames, |
||||
proxyquireObject, |
||||
}) |
||||
// console.log(`containerTest`, `${__dirname}/${sRootPath}tests/${testFilePath}`, containerTest);
|
||||
console.log('----') |
||||
console.log(`sRootPath`, sRootPath) |
||||
console.log(`testFilePath`, testFilePath) |
||||
await promisify(fs.writeFile)( |
||||
`${__dirname}/${sRootPath}tests/${testFilePath}`, |
||||
containerTest, |
||||
'utf8' |
||||
) |
||||
} |
||||
} |
||||
) |
||||
}, (err) => { |
||||
console.log('123', err) |
||||
}) |
||||
|
||||
} |
||||
/* |
||||
function generateMethodList (methodArray) { |
||||
return methodArray.map(n => ' ' + n).join(',\n') + ',' |
||||
} |
||||
|
||||
function generateMethodDescribeBlock (methodName, index) { |
||||
const describeBlock = |
||||
`${index ? ' ' : ''}describe('${methodName}()', () => {
|
||||
it('should', () => { |
||||
const state = {} |
||||
|
||||
assert.equal(${methodName}(state), ) |
||||
}) |
||||
})` |
||||
return describeBlock |
||||
} |
||||
*/ |
||||
function generateDispatchMethodDescribeBlock (methodName, index) { |
||||
const describeBlock = |
||||
`${index ? ' ' : ''}describe('${methodName}()', () => {
|
||||
it('should dispatch an action', () => { |
||||
mapDispatchToPropsObject.${methodName}() |
||||
assert(dispatchSpy.calledOnce) |
||||
}) |
||||
})` |
||||
return describeBlock |
||||
} |
||||
/* |
||||
function generateMethodDescribeBlocks (methodArray) { |
||||
return methodArray |
||||
.map((methodName, index) => generateMethodDescribeBlock(methodName, index)) |
||||
.join('\n\n') |
||||
} |
||||
*/ |
||||
|
||||
function generateDispatchMethodDescribeBlocks (methodArray) { |
||||
return methodArray |
||||
.map((methodName, index) => generateDispatchMethodDescribeBlock(methodName, index)) |
||||
.join('\n\n') |
||||
} |
||||
|
||||
/* |
||||
function generateSelectorTest (name, methodArray) { |
||||
return `import assert from 'assert'
|
||||
import { |
||||
${generateMethodList(methodArray)} |
||||
} from '../${name}' |
||||
|
||||
describe('${name.match(/^[^.]+/)} selectors', () => { |
||||
|
||||
${generateMethodDescribeBlocks(methodArray)} |
||||
|
||||
})` |
||||
} |
||||
|
||||
function generateUtilTest (name, methodArray) { |
||||
return `import assert from 'assert'
|
||||
import { |
||||
${generateMethodList(methodArray)} |
||||
} from '../${name}' |
||||
|
||||
describe('${name.match(/^[^.]+/)} utils', () => { |
||||
|
||||
${generateMethodDescribeBlocks(methodArray)} |
||||
|
||||
})` |
||||
} |
||||
*/ |
||||
|
||||
function generateContainerTest (sPath, { |
||||
mapStateToPropsAssertionObject, |
||||
mapDispatchToPropsMethodNames, |
||||
proxyquireObject, |
||||
}) { |
||||
return `import assert from 'assert'
|
||||
import proxyquire from 'proxyquire' |
||||
import sinon from 'sinon' |
||||
|
||||
let mapStateToProps |
||||
let mapDispatchToProps |
||||
|
||||
proxyquire('../${sPath}', ${proxyquireObject}) |
||||
|
||||
describe('${sPath.match(/^[^.]+/)} container', () => { |
||||
|
||||
describe('mapStateToProps()', () => { |
||||
|
||||
it('should map the correct properties to props', () => { |
||||
assert.deepEqual(mapStateToProps('mockState'), ${mapStateToPropsAssertionObject}) |
||||
}) |
||||
|
||||
}) |
||||
|
||||
describe('mapDispatchToProps()', () => { |
||||
let dispatchSpy |
||||
let mapDispatchToPropsObject |
||||
|
||||
beforeEach(() => { |
||||
dispatchSpy = sinon.spy() |
||||
mapDispatchToPropsObject = mapDispatchToProps(dispatchSpy) |
||||
}) |
||||
|
||||
${mapDispatchToPropsMethodNames ? generateDispatchMethodDescribeBlocks(mapDispatchToPropsMethodNames) : 'delete'} |
||||
|
||||
}) |
||||
|
||||
})` |
||||
} |
@ -0,0 +1,6 @@ |
||||
Dear MetaMask Users, |
||||
|
||||
There have been several instances of high-profile legitimate websites such as BTC Manager and Games Workshop that have had their websites temporarily compromised. This involves showing a fake MetaMask window on the page asking for user's seed phrases. MetaMask will never open itself in this way and users are encouraged to report these instances immediately to either [our phishing blacklist](https://github.com/MetaMask/eth-phishing-detect/issues) or our support email at [support@metamask.io](mailto:support@metamask.io). |
||||
|
||||
Please read our full article on this ongoing issue at [https://medium.com/metamask/new-phishing-strategy-becoming-common-1b1123837168](https://medium.com/metamask/new-phishing-strategy-becoming-common-1b1123837168). |
||||
|
@ -1,27 +0,0 @@ |
||||
var fs = require('fs') |
||||
var path = require('path') |
||||
var prompt = require('prompt') |
||||
var open = require('open') |
||||
var extend = require('extend') |
||||
var notices = require('./notices.json') |
||||
|
||||
|
||||
console.log('List of Notices') |
||||
console.log(`ID \t DATE \t\t\t TITLE`) |
||||
notices.forEach((notice) => { |
||||
console.log(`${(' ' + notice.id).slice(-2)} \t ${notice.date} \t ${notice.title}`) |
||||
}) |
||||
prompt.get(['id'], (error, res) => { |
||||
prompt.start() |
||||
if (error) { |
||||
console.log("Exiting...") |
||||
process.exit() |
||||
} |
||||
var index = notices.findIndex((notice) => { return notice.id == res.id}) |
||||
if (index === -1) { |
||||
console.log('Notice not found. Exiting...') |
||||
} |
||||
notices.splice(index, 1) |
||||
fs.unlink(`notices/archive/notice_${res.id}.md`) |
||||
fs.writeFile(`notices/notices.json`, JSON.stringify(notices)) |
||||
}) |
@ -1,33 +0,0 @@ |
||||
var fsp = require('fs-promise') |
||||
var path = require('path') |
||||
var prompt = require('prompt') |
||||
var open = require('open') |
||||
var extend = require('extend') |
||||
var notices = require('./notices.json') |
||||
var id = Number(require('./notice-nonce.json')) |
||||
|
||||
var date = new Date().toDateString() |
||||
|
||||
var notice = { |
||||
read: false, |
||||
date: date, |
||||
} |
||||
|
||||
fsp.writeFile(`notices/archive/notice_${id}.md`,'Message goes here. Please write out your notice and save before proceeding at the command line.') |
||||
.then(() => { |
||||
open(`notices/archive/notice_${id}.md`) |
||||
prompt.start() |
||||
prompt.get(['title'], (err, result) => { |
||||
notice.title = result.title |
||||
fsp.readFile(`notices/archive/notice_${id}.md`) |
||||
.then((body) => { |
||||
notice.body = body.toString() |
||||
notice.id = id |
||||
notices.push(notice) |
||||
return fsp.writeFile(`notices/notices.json`, JSON.stringify(notices)) |
||||
}).then((completion) => { |
||||
id += 1 |
||||
return fsp.writeFile(`notices/notice-nonce.json`, id) |
||||
}) |
||||
}) |
||||
}) |
@ -1 +0,0 @@ |
||||
4 |
@ -0,0 +1,35 @@ |
||||
// fs.readFileSync is inlined by browserify transform "brfs"
|
||||
const fs = require('fs') |
||||
const path = require('path') |
||||
|
||||
module.exports = [ |
||||
{ |
||||
id: 0, |
||||
read: false, |
||||
date: 'Thu Feb 09 2017', |
||||
title: 'Terms of Use', |
||||
body: fs.readFileSync(path.join(__dirname, '/archive', 'notice_0.md'), 'utf8'), |
||||
}, |
||||
{ |
||||
id: 2, |
||||
read: false, |
||||
date: 'Mon May 08 2017', |
||||
title: 'Privacy Notice', |
||||
body: fs.readFileSync(path.join(__dirname, '/archive', 'notice_2.md'), 'utf8'), |
||||
}, |
||||
{ |
||||
id: 3, |
||||
read: false, |
||||
date: 'Tue Nov 28 2017', |
||||
title: 'Seed Phrase Alert', |
||||
firstVersion: '<=3.12.0', |
||||
body: fs.readFileSync(path.join(__dirname, '/archive', 'notice_3.md'), 'utf8'), |
||||
}, |
||||
{ |
||||
id: 4, |
||||
read: false, |
||||
date: 'Wed Jun 13 2018', |
||||
title: 'Phishing Warning', |
||||
body: fs.readFileSync(path.join(__dirname, '/archive', 'notice_4.md'), 'utf8'), |
||||
}, |
||||
] |
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,66 @@ |
||||
/* |
||||
The `piggybankContract` is compiled from: |
||||
|
||||
pragma solidity ^0.4.0; |
||||
contract PiggyBank { |
||||
|
||||
uint private balance; |
||||
address public owner; |
||||
|
||||
function PiggyBank() public { |
||||
owner = msg.sender; |
||||
balance = 0; |
||||
} |
||||
|
||||
function deposit() public payable returns (uint) { |
||||
balance += msg.value; |
||||
return balance; |
||||
} |
||||
|
||||
function withdraw(uint withdrawAmount) public returns (uint remainingBal) { |
||||
require(msg.sender == owner); |
||||
balance -= withdrawAmount; |
||||
|
||||
msg.sender.transfer(withdrawAmount); |
||||
|
||||
return balance; |
||||
} |
||||
} |
||||
*/ |
||||
|
||||
var piggybankContract = web3.eth.contract([{'constant': false, 'inputs': [{'name': 'withdrawAmount', 'type': 'uint256'}], 'name': 'withdraw', 'outputs': [{'name': 'remainingBal', 'type': 'uint256'}], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': true, 'inputs': [], 'name': 'owner', 'outputs': [{'name': '', 'type': 'address'}], 'payable': false, 'stateMutability': 'view', 'type': 'function'}, {'constant': false, 'inputs': [], 'name': 'deposit', 'outputs': [{'name': '', 'type': 'uint256'}], 'payable': true, 'stateMutability': 'payable', 'type': 'function'}, {'inputs': [], 'payable': false, 'stateMutability': 'nonpayable', 'type': 'constructor'}]) |
||||
const deployButton = document.getElementById('deployButton') |
||||
const depositButton = document.getElementById('depositButton') |
||||
const withdrawButton = document.getElementById('withdrawButton') |
||||
|
||||
deployButton.addEventListener('click', async function (event) { |
||||
|
||||
var piggybank = await piggybankContract.new( |
||||
{ |
||||
from: web3.eth.accounts[0], |
||||
data: '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', |
||||
gas: '4700000', |
||||
}, function (e, contract) { |
||||
console.log(e, contract) |
||||
if (typeof contract.address !== 'undefined') { |
||||
console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash) |
||||
|
||||
console.log(`contract`, contract) |
||||
|
||||
depositButton.addEventListener('click', function (event) { |
||||
contract.deposit({ from: web3.eth.accounts[0], value: '0x29a2241af62c0000' }, function (result) { |
||||
console.log(result) |
||||
}) |
||||
}) |
||||
|
||||
withdrawButton.addEventListener('click', function (event) { |
||||
contract.withdraw('0xde0b6b3a7640000', { from: web3.eth.accounts[0] }, function (result) { |
||||
console.log(result) |
||||
}) |
||||
}) |
||||
} |
||||
}) |
||||
|
||||
console.log(piggybank) |
||||
|
||||
}) |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue