Skip to content

Instantly share code, notes, and snippets.

@nuevoalex
Created April 8, 2019 20:45
Show Gist options
  • Save nuevoalex/b8ce4c0a0dd5f78f853ffc4591224bcb to your computer and use it in GitHub Desktop.
Save nuevoalex/b8ce4c0a0dd5f78f853ffc4591224bcb to your computer and use it in GitHub Desktop.
Interfaces
pragma solidity ^0.5.0;
contract ERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
}
contract ShareToken is ERC20 {
function getTypeName() public view returns(bytes32);
function getMarket() external view returns(address);
function getOutcome() external view returns(uint256);
}
contract ClaimTradingProceeds {
function claimTradingProceeds(address _market, address _shareHolder) external returns(bool);
}
contract Mailbox {
function depositEther() public payable returns (bool);
function withdrawEther() public returns (bool);
}
contract Controller {
address public owner;
address public uploader;
mapping(bytes32 => address) public registry;
function addToWhitelist(address _target) public returns (bool);
function removeFromWhitelist(address _target) public returns (bool);
function assertIsWhitelisted(address _target) public view returns (bool);
function registerContract(bytes32 _key, address _address) public returns (bool);
function getContractDetails(bytes32 _key) public view returns (address, bytes20, bytes32);
function unregisterContract(bytes32 _key) public returns (bool);
function lookup(bytes32 _key) public view returns (address);
function updateController(address _target, address _newController) public returns (bool);
function transferOwnership(address _newOwner) public returns (bool);
function switchModeSoOnlyEmergencyStopsAndEscapeHatchesCanBeUsed() public returns (bool);
function emergencyStop() public returns (bool);
function release() public returns (bool);
function stopInEmergency() public view returns (bool);
function onlyInEmergency() public view returns (bool);
function getAugur() public view returns (address);
function getTimestamp() public view returns (uint256);
}
contract RepPriceOracle {
function getOwner() public view returns (address);
function transferOwnership(address _newOwner) public returns (bool);
function setRepPriceInAttoEth(uint256 _repPriceInAttoEth) external returns (bool);
function getRepPriceInAttoEth() external view returns (uint256);
}
contract FeeWindow {
function getNumMarkets() public view returns (uint256);
function getNumInvalidMarkets() public view returns (uint256);
function getNumIncorrectDesignatedReportMarkets() public view returns (uint256);
function getNumDesignatedReportNoShows() public view returns (uint256);
}
contract Orders {
function getPrice(bytes32 _orderId) public view returns (uint256);
function getOrderCreator(bytes32 _orderId) public view returns (address);
function getOrderAmount(bytes32 _orderId) public view returns (address);
}
contract LegacyReputationToken {
function faucet(uint256 _amount) public returns (bool);
function totalSupply() public view returns (uint);
}
contract ReputationToken {
function migrateFromLegacyReputationToken() public returns (bool);
function getLegacyRepToken() public view returns (address);
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
}
contract Universe {
function isForking() public view returns (bool);
function getReputationToken() public view returns (address);
function getOrCacheMarketCreationCost() public view returns (uint256);
function getOrCacheTargetReporterGasCosts() public view returns (uint256);
function getOrCacheReportingFeeDivisor() public view returns (uint256);
function getOpenInterestInAttoEth() public view returns (uint256);
function getCurrentFeeWindow() public view returns (address);
function getOrCacheDesignatedReportStake() public view returns (uint256);
function getOrCacheDesignatedReportNoShowBond() public view returns (uint256);
function getOrCreatePreviousPreviousFeeWindow() public view returns (address);
function getRepMarketCapInAttoeth() public view returns (uint256);
function getTargetRepMarketCapInAttoeth() public view returns (uint256);
}
contract Cash is ERC20 {
string constant public name = "CashXXX";
string constant public symbol = "CASHXXX";
uint8 constant public decimals = 42;
function depositEther() external payable returns(bool);
function depositEtherFor(address _to) external payable returns(bool);
function withdrawEther(uint256 _amount) external returns(bool);
function withdrawEtherTo(address _to, uint256 _amount) external returns(bool);
}
contract TimeControlled {
function getTimestamp() external view returns (uint256);
function incrementTimestamp(uint256 _amount) external returns (bool);
function setTimestamp(uint256 _timestamp) external returns (bool);
function getTypeName() public view returns (bytes32);
}
contract Market {
function getEndTime() public view returns (uint256);
function contribute(uint256[] memory _payoutNumerators, bool _invalid, uint256 _amount) public returns (bool);
function doInitialReport(uint256[] memory _payoutNumerators, bool _invalid) public returns (bool);
function migrateThroughOneFork() public returns (bool);
function disavowCrowdsourcers() public returns (bool);
function getFeeWindow() public view returns (address);
function getDisputeWindow() public view returns (address);
function getNumParticipants() public view returns (uint256);
function getParticipantStake() public view returns (uint256);
function getShareToken(uint256 _outcome) public view returns (address);
function getInitialReporter() public view returns (address);
function getMarketCreatorMailbox() public view returns (address);
}
contract IOrders {
function saveOrder(uint8 _type, address _market, uint256 _fxpAmount, uint256 _price, address _sender, uint256 _outcome, uint256 _moneyEscrowed, uint256 _sharesEscrowed, bytes32 _betterOrderId, bytes32 _worseOrderId, bytes32 _tradeGroupId) public returns (bytes32 _orderId);
function removeOrder(bytes32 _orderId) public returns (bool);
function getMarket(bytes32 _orderId) public view returns (address);
function getOrderType(bytes32 _orderId) public view returns (uint8);
function getOutcome(bytes32 _orderId) public view returns (uint256);
function getAmount(bytes32 _orderId) public view returns (uint256);
function getPrice(bytes32 _orderId) public view returns (uint256);
function getOrderCreator(bytes32 _orderId) public view returns (address);
function getOrderSharesEscrowed(bytes32 _orderId) public view returns (uint256);
function getOrderMoneyEscrowed(bytes32 _orderId) public view returns (uint256);
function getBetterOrderId(bytes32 _orderId) public view returns (bytes32);
function getWorseOrderId(bytes32 _orderId) public view returns (bytes32);
function getBestOrderId(uint8 _type, address _market, uint256 _outcome) public view returns (bytes32);
function getWorstOrderId(uint8 _type, address _market, uint256 _outcome) public view returns (bytes32);
function getLastOutcomePrice(address _market, uint256 _outcome) public view returns (uint256);
function getOrderId(uint8 _type, address _market, uint256 _fxpAmount, uint256 _price, address _sender, uint256 _blockNumber, uint256 _outcome, uint256 _moneyEscrowed, uint256 _sharesEscrowed) public pure returns (bytes32);
function getTotalEscrowed(address _market) public view returns (uint256);
function isBetterPrice(uint8 _type, uint256 _price, bytes32 _orderId) public view returns (bool);
function isWorsePrice(uint8 _type, uint256 _price, bytes32 _orderId) public view returns (bool);
function assertIsNotBetterPrice(uint8 _type, uint256 _price, bytes32 _betterOrderId) public view returns (bool);
function assertIsNotWorsePrice(uint8 _type, uint256 _price, bytes32 _worseOrderId) public returns (bool);
function recordFillOrder(bytes32 _orderId, uint256 _sharesFilled, uint256 _tokensFilled) public returns (bool);
function setPrice(address _market, uint256 _outcome, uint256 _price) external returns (bool);
function incrementTotalEscrowed(address _market, uint256 _amount) external returns (bool);
function decrementTotalEscrowed(address _market, uint256 _amount) external returns (bool);
}
contract OrdersFinder {
function getExistingOrders50(uint256 _type, address _market, uint256 _outcome) external view returns (bytes32[50] memory _results);
function getExistingOrders100(uint256 _type, address _market, uint256 _outcome) external view returns (bytes32[100] memory _results);
function getExistingOrders200(uint256 _type, address _market, uint256 _outcome) external view returns (bytes32[200] memory _results);
function getExistingOrders500(uint256 _type, address _market, uint256 _outcome) external view returns (bytes32[500] memory _results);
function getExistingOrders1000(uint256 _type, address _market, uint256 _outcome) external view returns (bytes32[1000] memory _results);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment