Skip to content

Commit eb987da

Browse files
author
Antony Jones
committed
initial commit
0 parents  commit eb987da

18 files changed

+7249
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
build

config/rollup.config.dev.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
'use strict'
2+
3+
const svelte = require('rollup-plugin-svelte')
4+
const url = require('rollup-plugin-url')
5+
const babel = require('rollup-plugin-babel')
6+
const json = require('rollup-plugin-json')
7+
const resolve = require('rollup-plugin-node-resolve')
8+
const commonjs = require('rollup-plugin-commonjs')
9+
const copy = require('rollup-plugin-copy')
10+
const css = require('rollup-plugin-postcss')
11+
12+
module.exports = [
13+
{
14+
input: 'src/main.js',
15+
output: {
16+
file: 'build/js/dapp.js',
17+
format: 'iife'
18+
},
19+
plugins: [
20+
// url({
21+
// limit: 1024 * 100,
22+
// include: [
23+
// 'src/components/**/*.woff2',
24+
// 'src/components/**/*.svg'
25+
// ]
26+
// }),
27+
copy({
28+
'src/index.html': 'build/index.html',
29+
'node_modules/web3/dist/web3.min.js': 'build/js/web3.min.js'
30+
}),
31+
css(),
32+
json(),
33+
commonjs({
34+
ignore: [ 'crypto', 'xmlhttprequest', 'xhr2' ]
35+
}),
36+
resolve(),
37+
svelte({
38+
include: 'src/components/**/*.html'
39+
}),
40+
babel({
41+
exclude: 'node_modules/**'
42+
})
43+
],
44+
external: ['web3']
45+
}
46+
]

contracts/Migrations.sol

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
pragma solidity ^0.4.4;
2+
3+
contract Migrations {
4+
address public owner;
5+
uint public last_completed_migration;
6+
7+
modifier restricted() {
8+
if (msg.sender == owner) _;
9+
}
10+
11+
function Migrations() {
12+
owner = msg.sender;
13+
}
14+
15+
function setCompleted(uint completed) restricted {
16+
last_completed_migration = completed;
17+
}
18+
19+
function upgrade(address new_address) restricted {
20+
Migrations upgraded = Migrations(new_address);
21+
upgraded.setCompleted(last_completed_migration);
22+
}
23+
}

contracts/SimpleStorage.sol

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
pragma solidity ^0.4.2;
2+
3+
contract SimpleStorage {
4+
uint storedData;
5+
6+
function set(uint x) {
7+
storedData = x;
8+
}
9+
10+
function get() constant returns (uint) {
11+
return storedData;
12+
}
13+
}

migrations/1_initial_migration.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var Migrations = artifacts.require("./Migrations.sol");
2+
3+
module.exports = function(deployer) {
4+
deployer.deploy(Migrations);
5+
};

migrations/2_deploy_contracts.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var SimpleStorage = artifacts.require("./SimpleStorage.sol");
2+
3+
module.exports = function(deployer) {
4+
deployer.deploy(SimpleStorage);
5+
};

0 commit comments

Comments
 (0)