Skip to content

Commit

Permalink
merge with latest development branch & fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
cwsnt committed Jan 19, 2024
2 parents a63b93b + 4495749 commit d5cfa9c
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 24 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn prettify-sol
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-sol && yarn prettier-check-sol
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
node_modules
artifacts
cache
tmp
temp
coverage*
gasReporterOutput.json
14 changes: 7 additions & 7 deletions contracts/mocks/helpers/InitializableReentrancyGuardMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";

interface IReentrantMock {
function clientMethod () external returns(bool);
function clientMethod() external returns (bool);
}

contract ReentrantMock is IReentrantMock {
address contractAddress;

constructor (address _contractAddress) {
constructor(address _contractAddress) {
contractAddress = _contractAddress;
}

function clientMethod() public returns(bool) {
function clientMethod() public returns (bool) {
InitializableReentrancyMock reentrancyMock = InitializableReentrancyMock(contractAddress);
reentrancyMock.runClientMethod(address(this));
return true;
}
}

contract NonReentrantMock is IReentrantMock {
function clientMethod() public pure returns(bool) {
function clientMethod() public pure returns (bool) {
return true;
}
}

contract InitializableReentrancyMock is ReentrancyGuardUpgradeable {
function initialize () public initializer {
function initialize() public initializer {
__ReentrancyGuard_init_unchained();
}

function runClientMethod (address reentrantMockAddress) public nonReentrant {
function runClientMethod(address reentrantMockAddress) public nonReentrant {
IReentrantMock reentrantMock = IReentrantMock(reentrantMockAddress);
require(reentrantMock.clientMethod(), "");
require(reentrantMock.clientMethod(), "");
}
}
3 changes: 1 addition & 2 deletions contracts/mocks/masset/MockBasketManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ pragma experimental ABIEncoderV2;

import { BasketManagerV3 } from "../../masset/BasketManagerV3.sol";

contract MockBasketManager is BasketManagerV3 {
}
contract MockBasketManager is BasketManagerV3 {}
6 changes: 3 additions & 3 deletions contracts/mocks/masset/MockDummy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
pragma solidity ^0.8.17;

abstract contract IMockDummy {
function getVersion() external virtual pure returns(string memory);
function getVersion() external pure virtual returns (string memory);
}

contract MockDummy1 is IMockDummy {
function getVersion() external virtual override pure returns (string memory) {
function getVersion() external pure virtual override returns (string memory) {
return "1";
}
}

contract MockDummy2 is IMockDummy {
function getVersion() external virtual override pure returns (string memory) {
function getVersion() external pure virtual override returns (string memory) {
return "2";
}
}
1 change: 0 additions & 1 deletion contracts/mocks/mynt/MockApprovalReceiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "../../interfaces/IApproveAndCall.sol";
* @dev Interfaces are used to cast a contract address into a callable instance.
*/
contract MockApprovalReceiver is IApproveAndCall {

address public sender;
uint256 public amount;
address public token;
Expand Down
21 changes: 10 additions & 11 deletions contracts/mocks/upgradability/MockProxyImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ contract MockDependency {
abstract contract IMockImplementation {
bool initialized;

function isInitialized() public view returns(bool) {
function isInitialized() public view returns (bool) {
return initialized;
}

function getVersion() external virtual pure returns(string memory);
function getVersion() external pure virtual returns (string memory);
}

contract MockProxyImplementation1 is IMockImplementation {
Expand All @@ -25,28 +25,27 @@ contract MockProxyImplementation1 is IMockImplementation {
initialized = true;
}

function getVersion() external override pure returns (string memory) {
function getVersion() external pure override returns (string memory) {
return "1";
}

function getDep () public view returns(address) {
function getDep() public view returns (address) {
return address(dep);
}
}

contract MockProxyImplementation2 is IMockImplementation {
MockDependency private dep;

function getVersion() external override pure returns (string memory) {
function getVersion() external pure override returns (string memory) {
return "2";
}

function getDep () public view returns(address) {
function getDep() public view returns (address) {
return address(dep);
}
}


contract MockProxyImplementationMetaAssetToken is IMockImplementation, ERC1967UpgradeUpgradeable {
MockDependency private dep;

Expand All @@ -55,17 +54,17 @@ contract MockProxyImplementationMetaAssetToken is IMockImplementation, ERC1967Up
initialized = true;
}

function getVersion() external override pure returns (string memory) {
function getVersion() external pure override returns (string memory) {
return "1";
}

function getDep () public view returns(address) {
function getDep() public view returns (address) {
return address(dep);
}

function getProxyImplementation() external view returns(address) {
function getProxyImplementation() external view returns (address) {
return ERC1967UpgradeUpgradeable._getImplementation();
}

receive() external payable {}
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"prepare": "yarn patch-package && rm -rf ./dist/ && set TS_NODE_TRANSPILE_ONLY=1 && yarn hardhat compile --force && tsc",
"contract-sizes": "yarn hardhat size-contracts",
"prettify": "prettier --write tests/**/*.ts types/generated/*.ts types/**/*.ts contracts/**/*.sol",
"prettify-sol": "prettier --write contracts/{*,**/*,**/**/*,**/**/**/*,**/**/**/**/*}.sol 2>&1 | grep -v 'No files matching the pattern were found'",
"prettier-check": "prettier --check .",
"prettier-check-sol": "prettier --check contracts/{*,**/*,**/**/*,**/**/**/*,**/**/**/**/*}.sol 2>&1 | grep -v 'No files matching the pattern were found'",
"flatten": "sol-merger \"./contracts/[^fish]**/*.sol\" ./_flat",
"prepublishOnly": "yarn run compile",
"docgen": "yarn hardhat compile --force && yarn run hardhat docgen",
Expand Down Expand Up @@ -101,6 +103,7 @@
"hardhat-deploy": "^0.11.15",
"hardhat-docgen": "^1.1.1",
"humanize-duration": "^3.21.0",
"husky": "^8.0.3",
"mocha": "^10.1.0",
"parse-duration": "^0.1.2",
"patch-package": "^5.0.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6844,6 +6844,11 @@ humanize-duration@^3.21.0:
resolved "https://registry.yarnpkg.com/humanize-duration/-/humanize-duration-3.28.0.tgz#f79770c0bec34d3bfd4899338cc40643bc04df72"
integrity sha512-jMAxraOOmHuPbffLVDKkEKi/NeG8dMqP8lGRd6Tbf7JgAeG33jjgPWDbXXU7ypCI0o+oNKJFgbSB9FKVdWNI2A==

husky@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==

[email protected], iconv-lite@^0.4.24:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
Expand Down

0 comments on commit d5cfa9c

Please sign in to comment.