Created
April 12, 2016 09:07
-
-
Save goodjoon/8abeb8a9f65fa8f410498b1b7584af0a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| contract owned { | |
| address owner; | |
| function owned() { | |
| owner = msg.sender; | |
| } | |
| modifier onlyowner { | |
| if (msg.sender != owner) { | |
| throw; | |
| } | |
| _ | |
| } | |
| } | |
| // Error Codes (bytes4) | |
| // 0x10000010 - 함수지정 없이 Contract 로 Transaction 옴 | |
| // Private Market Concept Test | |
| contract PrivateMarket is owned { | |
| struct IssuedShare { | |
| address issuerAddress; | |
| string shareName; | |
| bytes4 code; | |
| string issuerName; | |
| uint parValue; | |
| uint issueAmount; | |
| } | |
| mapping (bytes4 => IssuedShare) issuedShares; | |
| // Address 별 주식 현황 | |
| struct ShareStatus { | |
| bytes4 code; | |
| uint amount; | |
| uint spentValue; | |
| } | |
| mapping (address => mapping (bytes4 => ShareStatus)) shareStatus; | |
| uint tradeFeePercent; | |
| uint issueFee; | |
| event InvalidContractCall(address sender, bytes4 errorCode); | |
| // Fallback 함수 | |
| function() { | |
| InvalidContractCall(msg.sender, 0x10000010); | |
| throw; | |
| } | |
| function PrivateMarket(uint _tradeFeePercent, uint _issueFee) onlyowner { | |
| tradeFeePercent = _tradeFeePercent; | |
| issueFee = _issueFee; | |
| } | |
| function issueShare(string shareName, bytes4 code, string issuerName, uint issueAmount, uint parValue) { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment