Skip to content

Commit

Permalink
update INegRiskAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
mshrieve committed Dec 19, 2023
1 parent 6c20d86 commit 48c6749
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions src/interfaces/INegRiskAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@
pragma solidity ^0.8.15;

interface INegRiskAdapter {
type MarketData is bytes32;

error DeterminedFlagAlreadySet();
error FeeBipsOutOfBounds();
error IndexOutOfBounds();
error InvalidIndexSet();
error LengthMismatch();
error MarketAlreadyDetermined();
error MarketAlreadyPrepared();
error MarketNotPrepared();
error NoConvertiblePositions();
error NotAdmin();
error NotApprovedForAll();
error OnlyOracle();
error UnexpectedCollateralToken();

event MarketPrepared(bytes32 indexed marketId, address indexed oracle, uint256 feeBips, bytes data);
event NewAdmin(address indexed admin, address indexed newAdminAddress);
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);
Expand All @@ -11,9 +28,12 @@ interface INegRiskAdapter {
);
event PositionsMerge(address indexed stakeholder, bytes32 indexed conditionId, uint256 amount);
event QuestionPrepared(bytes32 indexed marketId, bytes32 indexed questionId, uint256 index, bytes data);
event RemovedAdmin(address indexed admin, address indexed removedAdmin);

function FEE_DENOMINATOR() external view returns (uint256);
function NO_TOKEN_BURN_ADDRESS() external view returns (address);
function addAdmin(address admin) external;
function admins(address) external view returns (uint256);
function balanceOf(address _owner, uint256 _id) external view returns (uint256);
function balanceOfBatch(address[] memory _owners, uint256[] memory _ids) external view returns (uint256[] memory);
function col() external view returns (address);
Expand All @@ -22,11 +42,12 @@ interface INegRiskAdapter {
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 getMarketData(bytes32 _marketId) external view returns (MarketData);
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 isAdmin(address addr) external view returns (bool);
function mergePositions(address _collateralToken, bytes32, bytes32 _conditionId, uint256[] memory, uint256 _amount)
external;
function mergePositions(bytes32 _conditionId, uint256 _amount) external;
Expand All @@ -37,14 +58,9 @@ interface INegRiskAdapter {
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 removeAdmin(address admin) external;
function renounceAdmin() external;
function reportOutcome(bytes32 _questionId, bool _outcome) external;
function safeBatchTransferFrom(
address _from,
address _to,
uint256[] memory _ids,
uint256[] memory _values,
bytes memory _data
) external;
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes memory _data) external;
function splitPosition(address _collateralToken, bytes32, bytes32 _conditionId, uint256[] memory, uint256 _amount)
external;
Expand Down

0 comments on commit 48c6749

Please sign in to comment.