-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
106 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ docs/ | |
|
||
# python virtualenv | ||
env/ | ||
|
||
node_modules/ |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
[profile.default] | ||
solc = "0.8.19" | ||
src = "src" | ||
out = "out" | ||
libs = ["lib"] | ||
|
Submodule ctf-exchange
added at
503c0a
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
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,13 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import {CTFExchange} from "lib/ctf-exchange/src/exchange/CTFExchange.sol"; | ||
import {ERC1155} from "lib/solmate/src/tokens/ERC1155.sol"; | ||
|
||
contract NegRiskCtfExchange is CTFExchange { | ||
constructor(address _collateral, address _negRiskAdapter, address _ctf, address _proxyFactory, address _safeFactory) | ||
CTFExchange(_collateral, _negRiskAdapter, _proxyFactory, _safeFactory) | ||
{ | ||
ERC1155(_ctf).setApprovalForAll(_negRiskAdapter, true); | ||
} | ||
} |
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,44 @@ | ||
pragma solidity ^0.8.10; | ||
|
||
interface Interface { | ||
event MarketPrepared(bytes32 indexed marketId, address indexed oracle, uint256 feeBips, bytes data); | ||
event OutcomeReported(bytes32 indexed marketId, bytes32 indexed questionId, bool outcome); | ||
event PayoutRedemption(address indexed redeemer, bytes32 indexed conditionId, uint256[] amounts, uint256 payout); | ||
event PositionSplit(address indexed stakeholder, bytes32 indexed conditionId, uint256 amount); | ||
event PositionsConverted( | ||
address indexed stakeholder, bytes32 indexed marketId, uint256 indexed indexSet, uint256 amount | ||
); | ||
event PositionsMerge(address indexed stakeholder, bytes32 indexed conditionId, uint256 amount); | ||
event QuestionPrepared(bytes32 indexed marketId, bytes32 indexed questionId, uint256 index, bytes data); | ||
|
||
function FEE_DENOMINATOR() external view returns (uint256); | ||
function NO_TOKEN_BURN_ADDRESS() external view returns (address); | ||
function col() external view returns (address); | ||
function convertPositions(bytes32 _marketId, uint256 _indexSet, uint256 _amount) external; | ||
function ctf() external view returns (address); | ||
function getConditionId(bytes32 _questionId) external view returns (bytes32); | ||
function getDetermined(bytes32 _marketId) external view returns (bool); | ||
function getFeeBips(bytes32 _marketId) external view returns (uint256); | ||
function getMarketData(bytes32 _marketId) external view returns (bytes32); | ||
function getOracle(bytes32 _marketId) external view returns (address); | ||
function getPositionId(bytes32 _questionId, bool _outcome) external view returns (uint256); | ||
function getQuestionCount(bytes32 _marketId) external view returns (uint256); | ||
function getResult(bytes32 _marketId) external view returns (uint256); | ||
function mergePositions(address _collateralToken, bytes32, bytes32 _conditionId, uint256[] memory, uint256 _amount) | ||
external; | ||
function mergePositions(bytes32 _conditionId, uint256 _amount) external; | ||
function onERC1155BatchReceived(address, address, uint256[] memory, uint256[] memory, bytes memory) | ||
external | ||
returns (bytes4); | ||
function onERC1155Received(address, address, uint256, uint256, bytes memory) external returns (bytes4); | ||
function prepareMarket(uint256 _feeBips, bytes memory _metadata) external returns (bytes32); | ||
function prepareQuestion(bytes32 _marketId, bytes memory _metadata) external returns (bytes32); | ||
function redeemPositions(bytes32 _conditionId, uint256[] memory _amounts) external; | ||
function reportOutcome(bytes32 _questionId, bool _outcome) external; | ||
function splitPosition(address _collateralToken, bytes32, bytes32 _conditionId, uint256[] memory, uint256 _amount) | ||
external; | ||
function splitPosition(bytes32 _conditionId, uint256 _amount) external; | ||
function vault() external view returns (address); | ||
function wcol() external view returns (address); | ||
} | ||
|
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ interface IMarketStateManagerEE { | |
/// @notice Manages market state on behalf of the NegRiskAdapter | ||
/// @author Mike Shrieve([email protected]) | ||
abstract contract MarketStateManager is IMarketStateManagerEE { | ||
mapping(bytes32 _marketId => MarketData) internal marketData; | ||
mapping(bytes32 => MarketData) internal marketData; | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
GETTERS | ||
|