Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Silva committed Jan 16, 2018
0 parents commit 9ad9fb5
Show file tree
Hide file tree
Showing 19 changed files with 12,756 additions and 0 deletions.
1,317 changes: 1,317 additions & 0 deletions build/contracts/BasicToken.json

Large diffs are not rendered by default.

696 changes: 696 additions & 0 deletions build/contracts/DetailedERC20.json

Large diffs are not rendered by default.

745 changes: 745 additions & 0 deletions build/contracts/ERC20.json

Large diffs are not rendered by default.

474 changes: 474 additions & 0 deletions build/contracts/ERC20Basic.json

Large diffs are not rendered by default.

827 changes: 827 additions & 0 deletions build/contracts/Migrations.json

Large diffs are not rendered by default.

1,668 changes: 1,668 additions & 0 deletions build/contracts/MintableToken.json

Large diffs are not rendered by default.

1,000 changes: 1,000 additions & 0 deletions build/contracts/OpenFundToken.json

Large diffs are not rendered by default.

841 changes: 841 additions & 0 deletions build/contracts/Ownable.json

Large diffs are not rendered by default.

1,347 changes: 1,347 additions & 0 deletions build/contracts/SafeMath.json

Large diffs are not rendered by default.

3,736 changes: 3,736 additions & 0 deletions build/contracts/StandardToken.json

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// solhint-disable
pragma solidity ^0.4.17;

contract Migrations {
address public owner;
uint public last_completed_migration;

modifier restricted() {
if (msg.sender == owner) _;
}

function Migrations() public {
owner = msg.sender;
}

function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}

function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
20 changes: 20 additions & 0 deletions contracts/OpenFundToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pragma solidity ^0.4.18;

import 'zeppelin-solidity/contracts/token/MintableToken.sol';
import 'zeppelin-solidity/contracts/token/DetailedERC20.sol';

contract OpenFundToken is MintableToken {
string public name;
string public symbol;
uint8 public decimals;

function OpenFundToken(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}

function getName() constant public returns (string) {
return name;
}
}
8 changes: 8 additions & 0 deletions contracts/PassiveFund.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pragma solidity ^0.4.18;

import 'zeppelin-solidity/contracts/token/MintableToken.sol';
import 'zeppelin-solidity/contracts/token/DetailedERC20.sol';

contract PassiveFund {

}
13 changes: 13 additions & 0 deletions experiment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var OpenFundToken = artifacts.require("./OpenFundToken.sol");

module.exports = function(callback) {
console.log(web3.eth.accounts[1]);
var token = OpenFundToken.deployed();
token.then(async function(instance) {
instance.mint(web3.eth.accounts[1], 100);
console.log(await instance.getName());
console.log(await instance.balanceOf(web3.eth.accounts[1]));
console.log(await instance.balanceOf(web3.eth.accounts[2]));
});
}

5 changes: 5 additions & 0 deletions migrations/1_initial_migration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var Migrations = artifacts.require("./Migrations.sol");

module.exports = function(deployer) {
deployer.deploy(Migrations);
};
5 changes: 5 additions & 0 deletions migrations/2_deploy_tokens.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var OpenFundToken = artifacts.require('./OpenFundToken.sol')

module.exports = (deployer) => {
deployer.deploy(OpenFundToken, "Fund 1 Token", "F1T", 8);
};
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "ethercontract",
"version": "1.0.0",
"description": "",
"main": "truffle-config.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"zeppelin-solidity": "^1.5.0"
}
}
4 changes: 4 additions & 0 deletions truffle-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
};
9 changes: 9 additions & 0 deletions truffle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*" // Match any network id
}
}
};

0 comments on commit 9ad9fb5

Please sign in to comment.