aboutsummaryrefslogtreecommitdiffstats
path: root/test/compilationTests/gnosis/Markets/Market.sol
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-13 02:38:52 +0800
committerGitHub <noreply@github.com>2017-07-13 02:38:52 +0800
commit757c500bda9a32cccc86e1ab24da31a99c0e6eac (patch)
tree7e9d18c3e48d0a90eb75cf3453354f3699d528d1 /test/compilationTests/gnosis/Markets/Market.sol
parent91f17a366202f5cac21a5a469c682ad86fe9ede8 (diff)
parentb1c1fb6c8314a8f756cb367bdaa73f4459f397f2 (diff)
downloaddexon-solidity-757c500bda9a32cccc86e1ab24da31a99c0e6eac.tar
dexon-solidity-757c500bda9a32cccc86e1ab24da31a99c0e6eac.tar.gz
dexon-solidity-757c500bda9a32cccc86e1ab24da31a99c0e6eac.tar.bz2
dexon-solidity-757c500bda9a32cccc86e1ab24da31a99c0e6eac.tar.lz
dexon-solidity-757c500bda9a32cccc86e1ab24da31a99c0e6eac.tar.xz
dexon-solidity-757c500bda9a32cccc86e1ab24da31a99c0e6eac.tar.zst
dexon-solidity-757c500bda9a32cccc86e1ab24da31a99c0e6eac.zip
Merge pull request #2562 from ethereum/addGnosisTestContracts
Gnosis compilation contracts.
Diffstat (limited to 'test/compilationTests/gnosis/Markets/Market.sol')
-rw-r--r--test/compilationTests/gnosis/Markets/Market.sol47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/compilationTests/gnosis/Markets/Market.sol b/test/compilationTests/gnosis/Markets/Market.sol
new file mode 100644
index 00000000..635b14db
--- /dev/null
+++ b/test/compilationTests/gnosis/Markets/Market.sol
@@ -0,0 +1,47 @@
+pragma solidity ^0.4.11;
+import "../Events/Event.sol";
+import "../MarketMakers/MarketMaker.sol";
+
+
+/// @title Abstract market contract - Functions to be implemented by market contracts
+contract Market {
+
+ /*
+ * Events
+ */
+ event MarketFunding(uint funding);
+ event MarketClosing();
+ event FeeWithdrawal(uint fees);
+ event OutcomeTokenPurchase(address indexed buyer, uint8 outcomeTokenIndex, uint outcomeTokenCount, uint cost);
+ event OutcomeTokenSale(address indexed seller, uint8 outcomeTokenIndex, uint outcomeTokenCount, uint profit);
+ event OutcomeTokenShortSale(address indexed buyer, uint8 outcomeTokenIndex, uint outcomeTokenCount, uint cost);
+
+ /*
+ * Storage
+ */
+ address public creator;
+ uint public createdAtBlock;
+ Event public eventContract;
+ MarketMaker public marketMaker;
+ uint24 public fee;
+ uint public funding;
+ int[] public netOutcomeTokensSold;
+ Stages public stage;
+
+ enum Stages {
+ MarketCreated,
+ MarketFunded,
+ MarketClosed
+ }
+
+ /*
+ * Public functions
+ */
+ function fund(uint _funding) public;
+ function close() public;
+ function withdrawFees() public returns (uint);
+ function buy(uint8 outcomeTokenIndex, uint outcomeTokenCount, uint maxCost) public returns (uint);
+ function sell(uint8 outcomeTokenIndex, uint outcomeTokenCount, uint minProfit) public returns (uint);
+ function shortSell(uint8 outcomeTokenIndex, uint outcomeTokenCount, uint minProfit) public returns (uint);
+ function calcMarketFee(uint outcomeTokenCost) public constant returns (uint);
+}