From 48c6749cc6a6c2eebb5c13ff2f6ef4d4a100f128 Mon Sep 17 00:00:00 2001 From: mike Date: Tue, 19 Dec 2023 15:20:16 -0800 Subject: [PATCH] update INegRiskAdapter --- src/interfaces/INegRiskAdapter.sol | 32 ++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/interfaces/INegRiskAdapter.sol b/src/interfaces/INegRiskAdapter.sol index 9b5866e..a256498 100644 --- a/src/interfaces/INegRiskAdapter.sol +++ b/src/interfaces/INegRiskAdapter.sol @@ -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); @@ -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); @@ -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; @@ -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;