Skip to content

Commit

Permalink
Upgraded solidity version from 0.5.16 to 0.8.13.
Browse files Browse the repository at this point in the history
  • Loading branch information
Debugger022 committed Mar 10, 2023
1 parent 10cef6a commit eb2a5c4
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion contracts/Governance/GovernorAlpha2.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;
pragma experimental ABIEncoderV2;

contract GovernorAlpha2 {
Expand Down
6 changes: 3 additions & 3 deletions contracts/Governance/Timelock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;

import "../Utils/SafeMath.sol";

Expand Down Expand Up @@ -51,7 +51,7 @@ contract Timelock {
delay = delay_;
}

function() external payable {}
receive() external payable {}

function setDelay(uint delay_) public {
require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
Expand Down Expand Up @@ -137,7 +137,7 @@ contract Timelock {
}

// solium-disable-next-line security/no-call-value
(bool success, bytes memory returnData) = target.call.value(value)(callData);
(bool success, bytes memory returnData) = target.call{ value: value }(callData);
require(success, "Timelock::executeTransaction: Transaction execution reverted.");

emit ExecuteTransaction(txHash, target, value, signature, data, eta);
Expand Down
4 changes: 2 additions & 2 deletions contracts/Governance/VTreasury.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;

import "../Utils/IBEP20.sol";
import "../Utils/SafeBEP20.sol";
Expand All @@ -20,7 +20,7 @@ contract VTreasury is Ownable {
/**
* @notice To receive BNB
*/
function() external payable {}
receive() external payable {}

/**
* @notice Withdraw Treasury BEP20 Tokens, Only owner call it
Expand Down
8 changes: 4 additions & 4 deletions contracts/InterestRateModels/InterestRateModel.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;

/**
* @title Venus's InterestRateModel Interface
* @author Venus
*/
contract InterestRateModel {
abstract contract InterestRateModel {
/// @notice Indicator that this is an InterestRateModel contract (for inspection)
bool public constant isInterestRateModel = true;

Expand All @@ -15,7 +15,7 @@ contract InterestRateModel {
* @param reserves The total amnount of reserves the market has
* @return The borrow rate per block (as a percentage, and scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);
function getBorrowRate(uint cash, uint borrows, uint reserves) external view virtual returns (uint);

/**
* @notice Calculates the current supply interest rate per block
Expand All @@ -30,5 +30,5 @@ contract InterestRateModel {
uint borrows,
uint reserves,
uint reserveFactorMantissa
) external view returns (uint);
) external view virtual returns (uint);
}
6 changes: 3 additions & 3 deletions contracts/InterestRateModels/JumpRateModel.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;

import "../Utils/SafeMath.sol";
import "./InterestRateModel.sol";
Expand Down Expand Up @@ -76,7 +76,7 @@ contract JumpRateModel is InterestRateModel {
* @param reserves The amount of reserves in the market
* @return The borrow rate percentage per block as a mantissa (scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) public view returns (uint) {
function getBorrowRate(uint cash, uint borrows, uint reserves) public view override returns (uint) {
uint util = utilizationRate(cash, borrows, reserves);

if (util <= kink) {
Expand All @@ -101,7 +101,7 @@ contract JumpRateModel is InterestRateModel {
uint borrows,
uint reserves,
uint reserveFactorMantissa
) public view returns (uint) {
) public view override returns (uint) {
uint oneMinusReserveFactor = uint(1e18).sub(reserveFactorMantissa);
uint borrowRate = getBorrowRate(cash, borrows, reserves);
uint rateToPool = borrowRate.mul(oneMinusReserveFactor).div(1e18);
Expand Down
6 changes: 3 additions & 3 deletions contracts/InterestRateModels/WhitePaperInterestRateModel.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;

import "../Utils/SafeMath.sol";
import "./InterestRateModel.sol";
Expand Down Expand Up @@ -63,7 +63,7 @@ contract WhitePaperInterestRateModel is InterestRateModel {
* @param reserves The amount of reserves in the market
* @return The borrow rate percentage per block as a mantissa (scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) public view returns (uint) {
function getBorrowRate(uint cash, uint borrows, uint reserves) public view override returns (uint) {
uint ur = utilizationRate(cash, borrows, reserves);
return ur.mul(multiplierPerBlock).div(1e18).add(baseRatePerBlock);
}
Expand All @@ -81,7 +81,7 @@ contract WhitePaperInterestRateModel is InterestRateModel {
uint borrows,
uint reserves,
uint reserveFactorMantissa
) public view returns (uint) {
) public view override returns (uint) {
uint oneMinusReserveFactor = uint(1e18).sub(reserveFactorMantissa);
uint borrowRate = getBorrowRate(cash, borrows, reserves);
uint rateToPool = borrowRate.mul(oneMinusReserveFactor).div(1e18);
Expand Down
2 changes: 1 addition & 1 deletion contracts/Lens/ComptrollerLens.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;
pragma experimental ABIEncoderV2;

import "../Tokens/VTokens/VBep20.sol";
Expand Down
6 changes: 3 additions & 3 deletions contracts/Oracle/PriceOracle.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pragma solidity ^0.5.16;
pragma solidity ^0.8.13;

import "../Tokens/VTokens/VToken.sol";

contract PriceOracle {
abstract contract PriceOracle {
/// @notice Indicator that this is a PriceOracle contract (for inspection)
bool public constant isPriceOracle = true;

Expand All @@ -12,5 +12,5 @@ contract PriceOracle {
* @return The underlying asset price mantissa (scaled by 1e18).
* Zero means the price is unavailable.
*/
function getUnderlyingPrice(VToken vToken) external view returns (uint);
function getUnderlyingPrice(VToken vToken) external view virtual returns (uint);
}
6 changes: 3 additions & 3 deletions contracts/Utils/Context.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;

/*
* @dev Provides information about the current execution context, including the
Expand All @@ -10,13 +10,13 @@ pragma solidity ^0.5.16;
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
abstract contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor() internal {}

function _msgSender() internal view returns (address payable) {
return msg.sender;
return payable(msg.sender);
}

function _msgData() internal view returns (bytes memory) {
Expand Down
12 changes: 6 additions & 6 deletions contracts/VRTVault/VRTVaultProxy.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;

import "./VRTVaultStorage.sol";

Expand Down Expand Up @@ -62,7 +62,7 @@ contract VRTVaultProxy is VRTVaultAdminStorage {
(bool success, bytes memory returnData) = callee.delegatecall(data);
assembly {
if eq(success, 0) {
revert(add(returnData, 0x20), returndatasize)
revert(add(returnData, 0x20), returndatasize())
}
}
return returnData;
Expand Down Expand Up @@ -149,20 +149,20 @@ contract VRTVaultProxy is VRTVaultAdminStorage {
* It returns to the external caller whatever the implementation returns
* or forwards reverts.
*/
function() external payable {
fallback() external payable {
// delegate all other functions to current implementation
(bool success, ) = implementation.delegatecall(msg.data);

assembly {
let free_mem_ptr := mload(0x40)
returndatacopy(free_mem_ptr, 0, returndatasize)
returndatacopy(free_mem_ptr, 0, returndatasize())

switch success
case 0 {
revert(free_mem_ptr, returndatasize)
revert(free_mem_ptr, returndatasize())
}
default {
return(free_mem_ptr, returndatasize)
return(free_mem_ptr, returndatasize())
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions contracts/XVSVault/XVSVaultProxy.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.16;
pragma solidity 0.8.13;

import "./XVSVaultStorage.sol";
import "./XVSVaultErrorReporter.sol";
Expand Down Expand Up @@ -125,20 +125,20 @@ contract XVSVaultProxy is XVSVaultAdminStorage, XVSVaultErrorReporter {
* It returns to the external caller whatever the implementation returns
* or forwards reverts.
*/
function() external payable {
fallback() external payable {
// delegate all other functions to current implementation
(bool success, ) = implementation.delegatecall(msg.data);

assembly {
let free_mem_ptr := mload(0x40)
returndatacopy(free_mem_ptr, 0, returndatasize)
returndatacopy(free_mem_ptr, 0, returndatasize())

switch success
case 0 {
revert(free_mem_ptr, returndatasize)
revert(free_mem_ptr, returndatasize())
}
default {
return(free_mem_ptr, returndatasize)
return(free_mem_ptr, returndatasize())
}
}
}
Expand Down

0 comments on commit eb2a5c4

Please sign in to comment.