Skip to content

Commit

Permalink
Merge pull request #124 from ethereum-alarm-clock/feature/updagre-to-…
Browse files Browse the repository at this point in the history
…0.4.21

Upgrade to 0.4.21
  • Loading branch information
lsaether committed Mar 31, 2018
2 parents 59f900e + 26eb4f1 commit 2ebd650
Show file tree
Hide file tree
Showing 26 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion contracts/Interface/RequestFactoryInterface.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

contract RequestFactoryInterface {

Expand Down
2 changes: 1 addition & 1 deletion contracts/Interface/RequestTrackerInterface.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

contract RequestTrackerInterface {

Expand Down
2 changes: 1 addition & 1 deletion contracts/Interface/SchedulerInterface.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Library/RequestScheduleLib.sol";
import "contracts/Library/SchedulerLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/Interface/TransactionRequestInterface.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

contract TransactionRequestInterface {

Expand Down
2 changes: 1 addition & 1 deletion contracts/IterTools.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

/**
* @title IterTools
Expand Down
2 changes: 1 addition & 1 deletion contracts/Library/ClaimLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import 'contracts/zeppelin/SafeMath.sol';

Expand Down
2 changes: 1 addition & 1 deletion contracts/Library/ExecutionLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

/**
* @title ExecutionLib
Expand Down
2 changes: 1 addition & 1 deletion contracts/Library/GroveLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

/// @title GroveLib - Library for queriable indexed ordered data.
/// @author PiperMerriam - <pipermerriam@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion contracts/Library/MathLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

library MathLib {
uint constant INT_MAX = 57896044618658097711785492504343953926634992332820282019728792003956564819967; // 2**255 - 1
Expand Down
2 changes: 1 addition & 1 deletion contracts/Library/PaymentLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Library/ExecutionLib.sol";
import "contracts/Library/MathLib.sol";
Expand Down
36 changes: 18 additions & 18 deletions contracts/Library/RequestLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Library/ClaimLib.sol";
import "contracts/Library/ExecutionLib.sol";
Expand Down Expand Up @@ -313,7 +313,7 @@ library RequestLib {
* else:
* - throw (should be impossible)
*
* 6. msg.gas == callGas
* 6. gasleft() == callGas
*
* +--------------------+
* | Phase 2: Execution |
Expand All @@ -335,34 +335,34 @@ library RequestLib {

// Record the gas at the beginning of the transaction so we can
// calculate how much has been used later.
uint startGas = msg.gas;
uint startGas = gasleft();

// +----------------------+
// | Begin: Authorization |
// +----------------------+

if (msg.gas < requiredExecutionGas(self).sub(_PRE_EXECUTION_GAS)) {
Aborted(uint8(AbortReason.InsufficientGas));
if (gasleft() < requiredExecutionGas(self).sub(_PRE_EXECUTION_GAS)) {
emit Aborted(uint8(AbortReason.InsufficientGas));
return false;
} else if (self.meta.wasCalled) {
Aborted(uint8(AbortReason.AlreadyCalled));
emit Aborted(uint8(AbortReason.AlreadyCalled));
return false;
} else if (self.meta.isCancelled) {
Aborted(uint8(AbortReason.WasCancelled));
emit Aborted(uint8(AbortReason.WasCancelled));
return false;
} else if (self.schedule.isBeforeWindow()) {
Aborted(uint8(AbortReason.BeforeCallWindow));
emit Aborted(uint8(AbortReason.BeforeCallWindow));
return false;
} else if (self.schedule.isAfterWindow()) {
Aborted(uint8(AbortReason.AfterCallWindow));
emit Aborted(uint8(AbortReason.AfterCallWindow));
return false;
} else if (self.claimData.isClaimed() &&
msg.sender != self.claimData.claimedBy &&
self.schedule.inReservedWindow()) {
Aborted(uint8(AbortReason.ReservedForClaimer));
emit Aborted(uint8(AbortReason.ReservedForClaimer));
return false;
} else if (self.txnData.gasPrice != tx.gasprice) {
Aborted(uint8(AbortReason.MismatchGasPrice));
emit Aborted(uint8(AbortReason.MismatchGasPrice));
return false;
}

Expand Down Expand Up @@ -424,7 +424,7 @@ library RequestLib {

// Take down the amount of gas used so far in execution to compensate the executing agent.
uint measuredGasConsumption = startGas
.sub(msg.gas)
.sub(gasleft())
.add(_EXECUTE_EXTRA_GAS);

// // +----------------------------------------------------------------------+
Expand All @@ -438,7 +438,7 @@ library RequestLib {

// Log the bounty and fee. Otherwise it is non-trivial to figure
// out how much was payed.
Executed(self.paymentData.bountyOwed, totalFeePayment, measuredGasConsumption);
emit Executed(self.paymentData.bountyOwed, totalFeePayment, measuredGasConsumption);

// Attempt to send the bounty. as with `.sendFee()` it may fail and need to be caled after execution.
self.paymentData.sendBounty();
Expand Down Expand Up @@ -544,7 +544,7 @@ library RequestLib {
function cancel(Request storage self)
public returns (bool)
{
uint startGas = msg.gas;
uint startGas = gasleft();
uint rewardPayment;
uint measuredGasConsumption;

Expand All @@ -571,7 +571,7 @@ library RequestLib {

// Calculate the amount of gas cancelling agent used in this transaction.
measuredGasConsumption = startGas
.sub(msg.gas)
.sub(gasleft())
.add(_CANCEL_EXTRA_GAS);
// Add their gas fees to the reward.
rewardOwed = measuredGasConsumption
Expand All @@ -589,7 +589,7 @@ library RequestLib {
}

// Log it!
Cancelled(rewardPayment, measuredGasConsumption);
emit Cancelled(rewardPayment, measuredGasConsumption);

// Send the remaining ether to the owner.
return sendOwnerEther(self);
Expand Down Expand Up @@ -623,7 +623,7 @@ library RequestLib {
require( isClaimable(self) );

self.claimData.claim(self.schedule.computePaymentModifier());
Claimed();
emit Claimed();
claimed = true;
}

Expand Down Expand Up @@ -682,7 +682,7 @@ library RequestLib {
{
// Note! This does not do any checks since it is used in the execute function.
// The public version of the function should be used for checks and in the cancel function.
uint ownerRefund = this.balance
uint ownerRefund = address(this).balance
.sub(self.claimData.claimDeposit)
.sub(self.paymentData.bountyOwed)
.sub(self.paymentData.feeOwed);
Expand Down
2 changes: 1 addition & 1 deletion contracts/Library/RequestMetaLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

/**
* @title RequestMetaLib
Expand Down
2 changes: 1 addition & 1 deletion contracts/Library/RequestScheduleLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/zeppelin/SafeMath.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/Library/SchedulerLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Interface/RequestFactoryInterface.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

/// Truffle-specific contract (Not a part of the EAC)

Expand Down
2 changes: 1 addition & 1 deletion contracts/RequestFactory.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Interface/RequestFactoryInterface.sol";
import "contracts/Interface/RequestTrackerInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/RequestTracker.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Interface/RequestTrackerInterface.sol";
import "contracts/Library/GroveLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/Scheduler/BaseScheduler.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Interface/SchedulerInterface.sol";
import "contracts/Library/RequestScheduleLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/Scheduler/BlockScheduler.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Library/RequestScheduleLib.sol";
import "contracts/Scheduler/BaseScheduler.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/Scheduler/TimestampScheduler.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Library/RequestScheduleLib.sol";
import "contracts/Scheduler/BaseScheduler.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/TransactionRequestCore.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import "contracts/Library/RequestLib.sol";
import "contracts/Library/RequestScheduleLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/_examples/DelayedPayment.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

import 'contracts/Interface/SchedulerInterface.sol';

Expand Down
2 changes: 1 addition & 1 deletion contracts/_test/SimpleToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

/// Super simple token contract that moves funds into the owner account on creation and
/// only exposes an API to be used for `test/proxy.js`
Expand Down
4 changes: 2 additions & 2 deletions contracts/_test/TransactionRecorder.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;

contract TransactionRecorder {
address owner;
Expand All @@ -14,7 +14,7 @@ contract TransactionRecorder {
}

function() payable {
lastCallGas = msg.gas;
lastCallGas = gasleft();
lastCallData = msg.data;
lastCaller = msg.sender;
lastCallValue = msg.value;
Expand Down
2 changes: 1 addition & 1 deletion contracts/zeppelin/SafeMath.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.19;
pragma solidity ^0.4.21;


/**
Expand Down
2 changes: 1 addition & 1 deletion test/transaction-request/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ contract("TransactionRequestCore proxy function", (accounts) => {

// This is allowed since it is from scheduling accounts
const tx = await txRequest.proxy(accounts[7], testData32)
expect(tx.receipt.status).to.equal(1)
expect(tx.receipt.status).to.equal('0x01')
})

it("does some fancy stuff with proxy", async () => {
Expand Down

0 comments on commit 2ebd650

Please sign in to comment.