Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
add prefix Log to events
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Sarawgi committed Sep 5, 2018
1 parent 8caead0 commit 96512f7
Show file tree
Hide file tree
Showing 7 changed files with 2,185 additions and 2,123 deletions.
12 changes: 6 additions & 6 deletions contracts/MarketOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ contract MarketOracle is Ownable {
// Whitelist of sources
MarketSource[] public whitelist;

event SourceAdded(MarketSource source);
event SourceRemoved(MarketSource source);
event SourceExpired(MarketSource source);
event LogSourceAdded(MarketSource source);
event LogSourceRemoved(MarketSource source);
event LogSourceExpired(MarketSource source);

/**
* @return The volume weighted average of active exchange rates and the total trade volume.
Expand All @@ -34,7 +34,7 @@ contract MarketOracle is Ownable {

for (uint256 i = 0; i < whitelist.length; i++) {
if (!whitelist[i].isActive()) {
emit SourceExpired(whitelist[i]);
emit LogSourceExpired(whitelist[i]);
continue;
}

Expand All @@ -55,7 +55,7 @@ contract MarketOracle is Ownable {
*/
function addSource(MarketSource source) external onlyOwner {
whitelist.push(source);
emit SourceAdded(source);
emit LogSourceAdded(source);
}

/**
Expand Down Expand Up @@ -97,7 +97,7 @@ contract MarketOracle is Ownable {
*/
function removeSource(uint8 index) private {
require(index < whitelist.length);
emit SourceRemoved(whitelist[index]);
emit LogSourceRemoved(whitelist[index]);
if (index != whitelist.length-1) {
whitelist[index] = whitelist[whitelist.length-1];
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/MarketSource.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract MarketSource is Destructible {
using SafeMath for uint256;

event ExchangeRateReported(uint128 exchangeRate, uint128 volume24hrs, uint64 indexed posixTimestamp);
event LogExchangeRateReported(uint128 exchangeRate, uint128 volume24hrs, uint64 indexed posixTimestamp);

// Name of the source reporting exchange rates
string public name;
Expand Down Expand Up @@ -52,7 +52,7 @@ contract MarketSource is Destructible {
volume24hrs = _volume24hrs;
posixTimestamp = _posixTimestamp;

emit ExchangeRateReported(exchangeRate, volume24hrs, posixTimestamp);
emit LogExchangeRateReported(exchangeRate, volume24hrs, posixTimestamp);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions contracts/MarketSourceFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "./MarketSource.sol";
* @dev A factory which spawns MarketSource contracts.
*/
contract MarketSourceFactory {
event SourceCreated(address owner, string name, MarketSource source);
event LogSourceCreated(address owner, string name, MarketSource source);

/**
* @dev Any user may call this function to create a MarketSource,
Expand All @@ -20,7 +20,7 @@ contract MarketSourceFactory {
*/
function createSource(string name) public returns (MarketSource) {
MarketSource source = new MarketSource(name);
emit SourceCreated(msg.sender, name, source);
emit LogSourceCreated(msg.sender, name, source);
source.transferOwnership(msg.sender);
return source;
}
Expand Down
Loading

0 comments on commit 96512f7

Please sign in to comment.