Skip to content

Commit

Permalink
upgraded dependencies openzeppelin to v5
Browse files Browse the repository at this point in the history
  • Loading branch information
iChristwin committed Mar 11, 2024
1 parent 1fe8e0c commit 42bad08
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/Solaxy.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity ^0.8.24;

import "./XRC20.sol";
import "./interfaces/ISolaxy.sol";
import {UD60x18, ud60x18} from "@prb/[email protected].1/src/UD60x18.sol";
import {IERC721} from "@openzeppelin/contracts@4.9.3/interfaces/IERC721.sol";
import {UD60x18, ud60x18} from "@prb/[email protected].2/src/UD60x18.sol";
import {IERC721} from "@openzeppelin/contracts@5.0.2/interfaces/IERC721.sol";

/**
* @title Solaxy
Expand Down
31 changes: 18 additions & 13 deletions src/XRC20.sol
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity ^0.8.24;

import "@openzeppelin/contracts@4.9.3/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.9.3/token/ERC20/extensions/ERC20Permit.sol";
import "@openzeppelin/contracts@4.9.3/token/ERC20/extensions/ERC20Votes.sol";
import "@openzeppelin/contracts@4.9.3/token/ERC20/extensions/ERC20FlashMint.sol";
import "@openzeppelin/contracts@5.0.2/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@5.0.2/token/ERC20/extensions/ERC20Permit.sol";
import "@openzeppelin/contracts@5.0.2/token/ERC20/extensions/ERC20Votes.sol";
import "@openzeppelin/contracts@5.0.2/token/ERC20/extensions/ERC20FlashMint.sol";

abstract contract XRC20 is ERC20, ERC20Permit, ERC20Votes, ERC20FlashMint {
// The following functions are overrides required by Solidity.

function _afterTokenTransfer(address from, address to, uint256 amount) internal override(ERC20, ERC20Votes) {
super._afterTokenTransfer(from, to, amount);
function _update(address from, address to, uint256 value)
internal
override(ERC20, ERC20Votes)
{
super._update(from, to, value);
}

function _mint(address to, uint256 amount) internal override(ERC20, ERC20Votes) {
super._mint(to, amount);
}

function _burn(address account, uint256 amount) internal override(ERC20, ERC20Votes) {
super._burn(account, amount);
function nonces(address owner)
public
view
override(ERC20Permit, Nonces)
returns (uint256)
{
return super.nonces(owner);
}
}

6 changes: 3 additions & 3 deletions src/interfaces/ISolaxy.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity ^0.8.24;

import {IERC4626} from "@openzeppelin/contracts@4.9.3/interfaces/IERC4626.sol";
import {UD60x18} from "@prb/[email protected].1/src/UD60x18.sol";
import {IERC4626} from "@openzeppelin/contracts@5.0.2/interfaces/IERC4626.sol";
import {UD60x18} from "@prb/[email protected].2/src/UD60x18.sol";

error PayableErr();
error Undersupply();
Expand Down
2 changes: 1 addition & 1 deletion test/Solaxy.invariant.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {StdUtils} from "forge-std/StdUtils.sol";
import {Test} from "forge-std/Test.sol";

import {Solaxy} from "../src/Solaxy.sol";
import {IERC20} from "@openzeppelin/contracts@4.9.3/interfaces/IERC20.sol";
import {IERC20} from "@openzeppelin/contracts@5.0.2/interfaces/IERC20.sol";
import {CannotBeZero, Undersupply} from "../src/interfaces/ISolaxy.sol";

uint256 constant sDAI_balanceOneBillion = 1e9 * 1e18;
Expand Down
4 changes: 2 additions & 2 deletions test/Solaxy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity ^0.8.19;
import {Test} from "forge-std/Test.sol";
import {Solaxy} from "../src/Solaxy.sol";
import {PayableErr, RequiresM3ter} from "../src/interfaces/ISolaxy.sol";
import {IERC20} from "@openzeppelin/contracts@4.9.3/interfaces/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts@4.9.3/interfaces/IERC721.sol";
import {IERC20} from "@openzeppelin/contracts@5.0.2/interfaces/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts@5.0.2/interfaces/IERC721.sol";

contract SolaxyTestWithoutM3ter is Test {
Solaxy public SLX;
Expand Down

0 comments on commit 42bad08

Please sign in to comment.