forked from faceyspacey/redux-first-router-demo
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some contracts and compile them with web3-loader and solc-loader
- Loading branch information
1 parent
90412ab
commit e7f7e94
Showing
11 changed files
with
558 additions
and
13 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pragma solidity ^0.4.4; | ||
|
||
library ConvertLib{ | ||
function convert(uint amount,uint conversionRate) returns (uint convertedAmount) | ||
{ | ||
return amount * conversionRate; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
pragma solidity ^0.4.4; | ||
|
||
import "./ConvertLib.sol"; | ||
|
||
// This is just a simple example of a coin-like contract. | ||
// It is not standards compatible and cannot be expected to talk to other | ||
// coin/token contracts. If you want to create a standards-compliant | ||
// token, see: https://github.com/ConsenSys/Tokens. Cheers! | ||
|
||
contract MetaCoin { | ||
mapping (address => uint) balances; | ||
|
||
event Transfer(address indexed _from, address indexed _to, uint256 _value); | ||
|
||
function MetaCoin() { | ||
balances[tx.origin] = 10000; | ||
} | ||
|
||
function sendCoin(address receiver, uint amount) returns(bool sufficient) { | ||
if (balances[msg.sender] < amount) return false; | ||
balances[msg.sender] -= amount; | ||
balances[receiver] += amount; | ||
Transfer(msg.sender, receiver, amount); | ||
return true; | ||
} | ||
|
||
function getBalanceInEth(address addr) returns(uint){ | ||
return ConvertLib.convert(getBalance(addr),2); | ||
} | ||
|
||
function getBalance(address addr) returns(uint) { | ||
return balances[addr]; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pragma solidity ^0.4.10; | ||
|
||
contract Counter { | ||
uint value; | ||
} |
Oops, something went wrong.