mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Implement override checking
This commit is contained in:
@@ -40,6 +40,7 @@ contract MultiSigWalletWithDailyLimit is MultiSigWallet {
|
||||
/// @param transactionId Transaction ID.
|
||||
function executeTransaction(uint transactionId)
|
||||
public
|
||||
override
|
||||
notExecuted(transactionId)
|
||||
{
|
||||
Transaction storage tx = transactions[transactionId];
|
||||
|
||||
@@ -12,7 +12,7 @@ contract thirdPartyPContractAbstract {
|
||||
contract ptokenDB is tokenDB {}
|
||||
|
||||
contract premium is module, safeMath {
|
||||
function replaceModule(address payable addr) external returns (bool success) {
|
||||
function replaceModule(address payable addr) external override returns (bool success) {
|
||||
require( super.isModuleHandler(msg.sender) );
|
||||
require( db.replaceOwner(addr) );
|
||||
super._replaceModule(addr);
|
||||
|
||||
@@ -9,14 +9,14 @@ contract provider is module, safeMath, announcementTypes {
|
||||
/*
|
||||
module callbacks
|
||||
*/
|
||||
function connectModule() external returns (bool success) {
|
||||
function connectModule() external override returns (bool success) {
|
||||
require( super.isModuleHandler(msg.sender) );
|
||||
super._connectModule();
|
||||
(bool _success, uint256 currentSchellingRound) = moduleHandler(moduleHandlerAddress).getCurrentSchellingRoundID();
|
||||
require( _success );
|
||||
return true;
|
||||
}
|
||||
function transferEvent(address payable from, address payable to, uint256 value) external returns (bool success) {
|
||||
function transferEvent(address payable from, address payable to, uint256 value) external override returns (bool success) {
|
||||
/*
|
||||
Transaction completed. This function is only available for the modulehandler.
|
||||
It should be checked if the sender or the acceptor does not connect to the provider or it is not a provider itself if so than the change should be recorded.
|
||||
@@ -31,7 +31,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
transferEvent_(to, value, false);
|
||||
return true;
|
||||
}
|
||||
function newSchellingRoundEvent(uint256 roundID, uint256 reward) external returns (bool success) {
|
||||
function newSchellingRoundEvent(uint256 roundID, uint256 reward) external override returns (bool success) {
|
||||
/*
|
||||
New schelling round. This function is only available for the moduleHandler.
|
||||
We are recording the new schelling round and we are storing the whole current quantity of the tokens.
|
||||
|
||||
@@ -9,7 +9,7 @@ contract publisher is announcementTypes, module, safeMath {
|
||||
/*
|
||||
module callbacks
|
||||
*/
|
||||
function transferEvent(address payable from, address payable to, uint256 value) external returns (bool success) {
|
||||
function transferEvent(address payable from, address payable to, uint256 value) external override returns (bool success) {
|
||||
/*
|
||||
Transaction completed. This function is available only for moduleHandler
|
||||
If a transaction is carried out from or to an address which participated in the objection of an announcement, its objection purport is automatically set
|
||||
|
||||
@@ -134,13 +134,13 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
/*
|
||||
module callbacks
|
||||
*/
|
||||
function replaceModule(address payable addr) external returns (bool) {
|
||||
function replaceModule(address payable addr) external override returns (bool) {
|
||||
require( super.isModuleHandler(msg.sender) );
|
||||
require( db.replaceOwner(addr) );
|
||||
super._replaceModule(addr);
|
||||
return true;
|
||||
}
|
||||
function transferEvent(address payable from, address payable to, uint256 value) external returns (bool) {
|
||||
function transferEvent(address payable from, address payable to, uint256 value) external override returns (bool) {
|
||||
/*
|
||||
Transaction completed. This function can be called only by the ModuleHandler.
|
||||
If this contract is the receiver, the amount will be added to the prize pool of the current round.
|
||||
|
||||
@@ -15,7 +15,7 @@ contract token is safeMath, module, announcementTypes {
|
||||
/*
|
||||
module callbacks
|
||||
*/
|
||||
function replaceModule(address payable addr) external returns (bool success) {
|
||||
function replaceModule(address payable addr) external override returns (bool success) {
|
||||
require( super.isModuleHandler(msg.sender) );
|
||||
require( db.replaceOwner(addr) );
|
||||
super._replaceModule(addr);
|
||||
|
||||
@@ -28,6 +28,7 @@ contract CategoricalEvent is Event {
|
||||
/// @return Sender's winnings
|
||||
function redeemWinnings()
|
||||
public
|
||||
override
|
||||
returns (uint winnings)
|
||||
{
|
||||
// Winning outcome has to be set
|
||||
@@ -45,6 +46,7 @@ contract CategoricalEvent is Event {
|
||||
/// @return Event hash
|
||||
function getEventHash()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (bytes32)
|
||||
{
|
||||
|
||||
@@ -47,6 +47,7 @@ contract ScalarEvent is Event {
|
||||
/// @return Sender's winnings
|
||||
function redeemWinnings()
|
||||
public
|
||||
override
|
||||
returns (uint winnings)
|
||||
{
|
||||
// Winning outcome has to be set
|
||||
@@ -79,6 +80,7 @@ contract ScalarEvent is Event {
|
||||
/// @return Event hash
|
||||
function getEventHash()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (bytes32)
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ contract LMSRMarketMaker is MarketMaker {
|
||||
/// @return Cost
|
||||
function calcCost(Market market, uint8 outcomeTokenIndex, uint outcomeTokenCount)
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (uint cost)
|
||||
{
|
||||
@@ -59,6 +60,7 @@ contract LMSRMarketMaker is MarketMaker {
|
||||
/// @return Profit
|
||||
function calcProfit(Market market, uint8 outcomeTokenIndex, uint outcomeTokenCount)
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (uint profit)
|
||||
{
|
||||
@@ -85,6 +87,7 @@ contract LMSRMarketMaker is MarketMaker {
|
||||
/// @return Marginal price of an outcome as a fixed point number
|
||||
function calcMarginalPrice(Market market, uint8 outcomeTokenIndex)
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (uint price)
|
||||
{
|
||||
|
||||
@@ -56,6 +56,7 @@ contract StandardMarket is Market {
|
||||
/// @param _funding Funding amount
|
||||
function fund(uint _funding)
|
||||
public
|
||||
override
|
||||
isCreator
|
||||
atStage(Stages.MarketCreated)
|
||||
{
|
||||
@@ -70,6 +71,7 @@ contract StandardMarket is Market {
|
||||
|
||||
/// @dev Allows market creator to close the markets by transferring all remaining outcome tokens to the creator
|
||||
function close()
|
||||
override
|
||||
public
|
||||
isCreator
|
||||
atStage(Stages.MarketFunded)
|
||||
@@ -85,6 +87,7 @@ contract StandardMarket is Market {
|
||||
/// @return Fee amount
|
||||
function withdrawFees()
|
||||
public
|
||||
override
|
||||
isCreator
|
||||
returns (uint fees)
|
||||
{
|
||||
@@ -101,6 +104,7 @@ contract StandardMarket is Market {
|
||||
/// @return Cost in collateral tokens
|
||||
function buy(uint8 outcomeTokenIndex, uint outcomeTokenCount, uint maxCost)
|
||||
public
|
||||
override
|
||||
atStage(Stages.MarketFunded)
|
||||
returns (uint cost)
|
||||
{
|
||||
@@ -131,6 +135,7 @@ contract StandardMarket is Market {
|
||||
/// @return Profit in collateral tokens
|
||||
function sell(uint8 outcomeTokenIndex, uint outcomeTokenCount, uint minProfit)
|
||||
public
|
||||
override
|
||||
atStage(Stages.MarketFunded)
|
||||
returns (uint profit)
|
||||
{
|
||||
@@ -161,6 +166,7 @@ contract StandardMarket is Market {
|
||||
/// @return Cost to short sell outcome in collateral tokens
|
||||
function shortSell(uint8 outcomeTokenIndex, uint outcomeTokenCount, uint minProfit)
|
||||
public
|
||||
override
|
||||
returns (uint cost)
|
||||
{
|
||||
// Buy all outcomes
|
||||
@@ -186,6 +192,7 @@ contract StandardMarket is Market {
|
||||
/// @return Fee for trade
|
||||
function calcMarketFee(uint outcomeTokenCost)
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (uint)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@ contract StandardMarketFactory is MarketFactory {
|
||||
/// @return Market contract
|
||||
function createMarket(Event eventContract, MarketMaker marketMaker, uint24 fee)
|
||||
public
|
||||
override
|
||||
returns (Market market)
|
||||
{
|
||||
market = new StandardMarket(msg.sender, eventContract, marketMaker, fee);
|
||||
|
||||
@@ -72,6 +72,7 @@ contract CentralizedOracle is Oracle {
|
||||
/// @return Is outcome set?
|
||||
function isOutcomeSet()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
@@ -82,6 +83,7 @@ contract CentralizedOracle is Oracle {
|
||||
/// @return Outcome
|
||||
function getOutcome()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (int)
|
||||
{
|
||||
|
||||
@@ -44,6 +44,7 @@ contract DifficultyOracle is Oracle {
|
||||
/// @return Is outcome set?
|
||||
function isOutcomeSet()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
@@ -55,6 +56,7 @@ contract DifficultyOracle is Oracle {
|
||||
/// @return Outcome
|
||||
function getOutcome()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (int)
|
||||
{
|
||||
|
||||
@@ -151,6 +151,7 @@ contract FutarchyOracle is Oracle {
|
||||
/// @return Is outcome set?
|
||||
function isOutcomeSet()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
@@ -161,6 +162,7 @@ contract FutarchyOracle is Oracle {
|
||||
/// @return Outcome
|
||||
function getOutcome()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (int)
|
||||
{
|
||||
|
||||
@@ -70,6 +70,7 @@ contract MajorityOracle is Oracle {
|
||||
/// @return Is outcome set?
|
||||
function isOutcomeSet()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
@@ -81,6 +82,7 @@ contract MajorityOracle is Oracle {
|
||||
/// @return Outcome
|
||||
function getOutcome()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (int)
|
||||
{
|
||||
|
||||
@@ -84,6 +84,7 @@ contract SignedMessageOracle is Oracle {
|
||||
/// @return Is outcome set?
|
||||
function isOutcomeSet()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
@@ -94,6 +95,7 @@ contract SignedMessageOracle is Oracle {
|
||||
/// @return Outcome
|
||||
function getOutcome()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (int)
|
||||
{
|
||||
|
||||
@@ -174,6 +174,7 @@ contract UltimateOracle is Oracle {
|
||||
/// @return Is outcome set?
|
||||
function isOutcomeSet()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (bool)
|
||||
{
|
||||
@@ -185,6 +186,7 @@ contract UltimateOracle is Oracle {
|
||||
/// @return Outcome
|
||||
function getOutcome()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (int)
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ contract StandardToken is Token {
|
||||
/// @return Was transfer successful?
|
||||
function transfer(address to, uint value)
|
||||
public
|
||||
override
|
||||
returns (bool)
|
||||
{
|
||||
if ( !balances[msg.sender].safeToSub(value)
|
||||
@@ -41,6 +42,7 @@ contract StandardToken is Token {
|
||||
/// @return Was transfer successful?
|
||||
function transferFrom(address from, address to, uint value)
|
||||
public
|
||||
override
|
||||
returns (bool)
|
||||
{
|
||||
if ( !balances[from].safeToSub(value)
|
||||
@@ -60,6 +62,7 @@ contract StandardToken is Token {
|
||||
/// @return Was approval successful?
|
||||
function approve(address spender, uint value)
|
||||
public
|
||||
override
|
||||
returns (bool)
|
||||
{
|
||||
allowances[msg.sender][spender] = value;
|
||||
@@ -73,6 +76,7 @@ contract StandardToken is Token {
|
||||
/// @return Remaining allowance for spender
|
||||
function allowance(address owner, address spender)
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (uint)
|
||||
{
|
||||
@@ -84,6 +88,7 @@ contract StandardToken is Token {
|
||||
/// @return Balance of owner
|
||||
function balanceOf(address owner)
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (uint)
|
||||
{
|
||||
@@ -94,6 +99,7 @@ contract StandardToken is Token {
|
||||
/// @return Total supply
|
||||
function totalSupply()
|
||||
public
|
||||
override
|
||||
view
|
||||
returns (uint)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user